loomnetwork/loom-js

Angular 8 compile problem

Opened this issue · 3 comments

chunk {main} main.js, main.js.map (main) 2.74 kB [initial] [rendered]
chunk {polyfills} polyfills.js, polyfills.js.map (polyfills) 123 kB [initial] [rendered]
chunk {runtime} runtime.js, runtime.js.map (runtime) 6.15 kB [entry] [rendered]
chunk {styles} styles.js, styles.js.map (styles) 10.4 kB [initial] [rendered]
chunk {vendor} vendor.js, vendor.js.map (vendor) 340 kB [initial] [rendered]
Date: 2019-11-22T10:27:50.204Z - Hash: ca4653b20d9bd208a0c5 - Time: 5992ms

ERROR in node_modules/loom-js/node_modules/web3/types.d.ts:1:10 - error TS2305: Module '"../@types/bn.js"' has no exported member 'BigNumber'.

1 import { BigNumber } from 'bn.js'
~~~~~~~~~
node_modules/loom-js/node_modules/web3/types.d.ts:1:27 - error TS2497: This module can only be referenced with ECMAScript imports/exports by turning on the 'allowSyntheticDefaultImports' flag and referencing its default export.

1 import { BigNumber } from 'bn.js'
~~~~~~~

** Angular Live Development Server is listening on localhost:4200, open your browser on http://localhost:4200/ **
ℹ 「wdm」: Failed to compile.
After installing loom-js on Angular 8 I got these errors! Any idea of how I can solve it?

my package.json
"private": true,
"dependencies": {
"@angular/animations": "~8.2.13",
"@angular/common": "~8.2.13",
"@angular/compiler": "~8.2.13",
"@angular/core": "~8.2.13",
"@angular/forms": "~8.2.13",
"@angular/platform-browser": "~8.2.13",
"@angular/platform-browser-dynamic": "~8.2.13",
"@angular/router": "~8.2.13",
"@fortawesome/angular-fontawesome": "^0.5.0",
"@fortawesome/fontawesome-svg-core": "^1.2.25",
"@fortawesome/free-solid-svg-icons": "^5.11.2",
"@ng-bootstrap/ng-bootstrap": "^5.1.4",
"@ngrx/store": "^8.5.0",
"loom-js": "^1.55.0",
"moment": "^2.24.0",
"rxjs": "^6.4.0",
"tslib": "^1.10.0",
"web3": "^1.2.2",
"zone.js": "~0.9.1"
},
"devDependencies": {
"@angular-devkit/build-angular": "~0.803.18",
"@angular/cli": "~8.3.18",
"@angular/compiler-cli": "~8.2.13",
"@angular/language-service": "~8.2.13",
"@types/jasmine": "~3.3.8",
"@types/jasminewd2": "~2.0.3",
"@types/node": "~8.9.4",
"codelyzer": "^5.0.0",
"jasmine-core": "~3.4.0",
"jasmine-spec-reporter": "~4.2.1",
"karma": "~4.1.0",
"karma-chrome-launcher": "~2.2.0",
"karma-coverage-istanbul-reporter": "~2.0.1",
"karma-jasmine": "~2.0.1",
"karma-jasmine-html-reporter": "^1.4.0",
"protractor": "~5.4.0",
"ts-node": "~7.0.0",
"tslint": "~5.15.0",
"typescript": "~3.5.3"
}

and tsconfig.json

{
"compileOnSave": false,
"typeRoots": [
"node_modules/@types"
],
"compilerOptions": {
"types": ["node"],
"allowSyntheticDefaultImports": true,
"baseUrl": "./",
"outDir": "./dist/out-tsc",
"sourceMap": true,
"declaration": false,
"downlevelIteration": true,
"experimentalDecorators": true,
"module": "esnext",
"moduleResolution": "node",
"importHelpers": true,
"target": "es2015",
"typeRoots": [
"node_modules/@types"
],
"lib": [
"es2018",
"dom"
]
},
"angularCompilerOptions": {
"fullTemplateTypeCheck": true,
"strictInjectionParameters": true
}
}

Thanks for help!

Seems errors gone after installing "loom-js": "1.60.4"

But I got several WARNINGS

WARNING in ./node_modules/@binance-chain/javascript-sdk/lib/ledger/index.js 28:71-112
Critical dependency: the request of a dependency is an expression

WARNING in ./node_modules/@binance-chain/javascript-sdk/lib/ledger/index.js 34:11-32
Critical dependency: the request of a dependency is an expression

WARNING in ./node_modules/loom-js/node_modules/web3-eth-accounts/src/scrypt.js 17:50-60
Critical dependency: the request of a dependency is an expression
ℹ 「wdm」: Compiled with warnings.

Any Idea how to solve it?
This error catastrophic errors?

I believe you can safely ignore those warnings, the script one may go away if you upgrade to loom-js@1.79.0.