ui-router / angular

UI-Router for Angular: State-based routing for Angular (v2+)
https://ui-router.github.io/ng2/
MIT License
354 stars 134 forks source link

Build / typescript type registration issue with Angular CLI #15

Closed niwrA closed 7 years ago

niwrA commented 7 years ago

10% building modules 2/2 modules 0 active(node:10804) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: Error encountered resolving symbol values statically. Function calls are not supported. Consider replacing the function or lambda with a reference to an exported function, resolving symbol AppModule in C:/angular2/SOFTWARE_MANAGEMENT/src/app/app.module.ts, resolving symbol AppModule in C:/angular2/SOFTWARE_MANAGEMENT/src/app/app.module.ts 20% building modules 87/87 modules 0 active

When I remove the references to UIRouterModule, then ng serve and then add them again, everything works just fine. So somewhere the type registration fails to happen at the right time? I'm fairly new at typescript and angular 2, so it may be a noobish error, but can't find what's causing it.

Should you want to dive into the sourcecode, it's public, here: https://github.com/niwrA/Software-Management-Angular2-Client

hansl commented 7 years ago

See https://github.com/ui-router/ng2/pull/13

christopherthielen commented 7 years ago

See https://github.com/angular-ui/ui-router/issues/3232

christopherthielen commented 7 years ago

I believe this was fixed in 1.0.0-beta.4.

Asone commented 6 years ago

I can confirm that i can still have this issue with the following dependencies :

├── UNMET PEER DEPENDENCY @angular/animations@4.4.6
├── @angular/cli@1.3.0
**├── @angular/common@4.4.6
├── @angular/compiler@4.4.6
├── @angular/compiler-cli@4.4.6
├── @angular/core@4.4.6
├── @angular/forms@4.4.6
├── @angular/http@4.4.6
├── @angular/platform-browser@4.4.6
├── @angular/platform-browser-dynamic@4.4.6
├── @angular/platform-server@4.4.6
├── @angular/router@4.4.6**
├── @types/bignumber.js@4.0.3
├── @types/classnames@2.2.3
├── @types/history@4.6.1
├── @types/jasmine@2.5.53
├── @types/jest@21.1.4
├── @types/lodash@4.14.78
├── @types/moment@2.13.0
├── @types/node@8.0.46
├── @types/prop-types@15.5.2
**├── @uirouter/angular@1.0.0-beta.9**
├── @uirouter/visualizer@4.0.2
├── babel-cli@6.26.0
├── babel-core@6.26.0
├── babel-eslint@7.2.3
├── babel-loader@7.1.2
├── babel-plugin-transform-runtime@6.23.0
├── babel-preset-env@1.6.1
├── babel-preset-es2015@6.24.1
├── babel-register@6.26.0
├── bip39@2.4.0
├── bn.js@4.11.8
├── bs58@4.0.1
├── cache-loader@1.1.0
├── codelyzer@3.1.2
├── copy-webpack-plugin@4.2.0
├── core-js@2.5.1
├── css-loader@0.28.7
├── eslint@4.9.0
├── eslint-config-standard@10.2.1
├── eslint-plugin-babel@4.1.2
├── UNMET PEER DEPENDENCY eslint-plugin-import@>=2.2.0
├── eslint-plugin-mocha@4.11.0
├── UNMET PEER DEPENDENCY eslint-plugin-node@>=4.2.2
├── eslint-plugin-promise@3.6.0
├── eslint-plugin-standard@3.0.1
├── ethereumjs-abi@0.6.4
├── ethereumjs-tx@1.3.3
├── ethereumjs-util@5.1.2
├── file-loader@0.11.2
├── html-webpack-plugin@2.30.1
├── jasmine-core@2.7.0
├── jasmine-spec-reporter@4.2.1
├── json-loader@0.5.7
├── karma@1.7.1
├── karma-chrome-launcher@2.2.0
├── karma-cli@1.0.1
├── karma-coverage-istanbul-reporter@1.3.0
├── karma-jasmine@1.1.0
├── karma-jasmine-html-reporter@0.2.2
├── protractor@5.1.2
├── rxjs@5.5.0
├── style-loader@0.18.2
├── truffle-contract@2.0.5
├── ts-node@3.3.0
├── tslint@5.6.0
├── typescript@2.4.2
├── wallet-address-validator@0.1.1
├── web3@0.20.0
├── webpack@3.8.1
├── webpack-dev-server@2.9.3
└── zone.js@0.8.18

npm ERR! peer dep missing: @angular/animations@4.4.6, required by @angular/platform-server@4.4.6 npm ERR! peer dep missing: eslint-plugin-import@>=2.2.0, required by eslint-config-standard@10.2.1 npm ERR! peer dep missing: eslint-plugin-node@>=4.2.2, required by eslint-config-standard@10.2.1


Note that i have the issue only on first transpilation. The next ones compile successfully

if more info needed feel free to ping me

Asone commented 6 years ago

apparently this could be a solution : See tip

I'll give it a try

christopherthielen commented 6 years ago

Yes, you should follow the AoT compiler requirements.

See these resources for more information: