Hi guys.
We are trying to use JS BalenaSDK to retrieve devices information. We need to use the SDK (rather than balena cloud directly) because we must merge informations provided from Balena with some local databases in our company. We need to display and manage data from BalenaSDK in an Angular 8 project.
The problem we are facing is the following: when launching the Angular app (with ng serve) we get a lot (like 30 or 40) errors. They all seem syntax errors, like the following:
ERROR in ../node_modules/balena-sdk/es2015/index.d.ts:2:13 - error TS1005: '=' expected.
2 import type { Pine as PineBase, PineStrict as PineStrictBase } from '../typings/balena-pine';
~
../node_modules/balena-sdk/es2015/index.d.ts:2:69 - error TS1005: ';' expected.
2 import type { Pine as PineBase, PineStrict as PineStrictBase } from '../typings/balena-pine';
~~~~~~~~~~~~~~~~~~~~~~~~
../node_modules/balena-sdk/es2015/index.d.ts:3:13 - error TS1005: '=' expected.
3 import type { BalenaRequest, Interceptor } from '../typings/balena-request';
~
../node_modules/balena-sdk/es2015/index.d.ts:3:49 - error TS1005: ';' expected.
3 import type { BalenaRequest, Interceptor } from '../typings/balena-request';
~~~~~~~~~~~~~~~~~~~~~~~~~~~
../node_modules/balena-sdk/es2015/index.d.ts:4:13 - error TS1005: '=' expected.
We installed the SDK using npm install balena-sdk
I don’t think this error is Angular-specific, I think it probably is related to Webpack or TypeScript transpiler, but I have no clue on how to solve it.
The project is using TypeScript 3.5.3.
Our IDE (Visual Studio) doesn’t show any syntax error and shows data types correctly while coding.
Do you have any idea? Thank you!