Error with Angular Cli build using AOT option
See original GitHub issueI haven’t added much after generating a angular project using Angular Cli, except for a few components. One using SignalR.
This warning bellow makes it impossible to compile with --prod or --aot options in Angular Cli…
Warning: Can't resolve all parameters for SignalR in C:/front-end/beskr
.../node_modules/ng2-signalr/src/services/signalr.d.ts: ([object Object], [object Object], ?). This will become an error in Angular v5.x
package.json
{
"name": "beskrivelse-frontend",
"version": "0.0.0",
"license": "MIT",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
"private": true,
"dependencies": {
"@angular/common": "^4.0.0",
"@angular/compiler": "^4.0.0",
"@angular/core": "^4.0.0",
"@angular/forms": "^4.0.0",
"@angular/http": "^4.0.0",
"@angular/platform-browser": "^4.0.0",
"@angular/platform-browser-dynamic": "^4.0.0",
"@angular/router": "^4.0.0",
"@biesbjerg/ngx-translate-po-http-loader": "^1.0.1",
"@ngrx/core": "^1.2.0",
"@ngrx/store": "^2.2.2",
"@ngrx/store-devtools": "^3.2.4",
"@ngx-translate/core": "^6.0.1",
"angular2-jwt": "^0.2.3",
"core-js": "^2.4.1",
"devextreme": "^16.2.6",
"devextreme-angular": "^16.2.6",
"ng2-cookies": "^1.0.12",
"ng2-signalr": "^2.0.3",
"rxjs": "^5.1.0",
"signalr": "^2.2.1",
"ts-md5": "^1.2.0",
"zone.js": "^0.8.4"
},
"devDependencies": {
"@angular/cli": "1.0.0",
"@angular/compiler-cli": "^4.0.0",
"@types/jasmine": "2.5.38",
"@types/node": "~6.0.60",
"codelyzer": "~2.0.0",
"jasmine-core": "~2.5.2",
"jasmine-spec-reporter": "~3.2.0",
"karma": "~1.4.1",
"karma-chrome-launcher": "~2.0.0",
"karma-cli": "~1.0.1",
"karma-jasmine": "~1.1.0",
"karma-jasmine-html-reporter": "^0.2.2",
"karma-coverage-istanbul-reporter": "^0.2.0",
"protractor": "~5.1.0",
"ts-node": "~2.0.0",
"tslint": "~4.5.0",
"typescript": "~2.2.0"
}
}
app.module
// signalR setup
export function createConfig(): SignalRConfiguration {
const signalRConfig = new SignalRConfiguration();
signalRConfig.hubName = 'Ng2SignalRHub';
signalRConfig.qs = {
user: 'test user'
};
signalRConfig.url = 'http://ng2-signalr-backend.azurewebsites.net/';
signalRConfig.logging = true;
return signalRConfig;
}
(...)
imports: [
SignalRModule.forRoot(createConfig),
Issue Analytics
- State:
- Created 6 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
Angular CLI - AOT error during ng build - Stack Overflow
Save this question. Show activity on this post. I created a application using Angular CLI and it works fine with the JIT compilation....
Read more >Building a project for production with aot and buildOptimizer ...
When building the project for production using ng build --prod with the options aot and buildOptimizer set to true in `angular,json, I get...
Read more >Ahead-of-time (AOT) compilation - Angular
This guide explains how to specify metadata and apply available compiler options to compile your applications efficiently using the AOT compiler.
Read more >Angular compiler options
When you use ahead-of-time compilation (AOT), you can control how your application is compiled by specifying template compiler options in the TypeScript ...
Read more >Creating libraries - Angular
Use the Angular CLI and the npm package manager to build and publish your library as an npm package. Angular CLI uses a...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@feitzi Have a look at #86 and #92 , @pbriones has created a PR that fixes it. 😃
This doesn’t seemed to have been addressed yet, right?
Using Angular 5, the compiler throws error that angular/core no longer exports OpaqueToken
WARNING in ./node_modules/ng2-signalr/src/modules/signalr-module.js 3:49-60 "export ‘OpaqueToken’ was not found in ‘@angular/core’