ngrx / platform

Reactive State for Angular
https://ngrx.io
Other
8.03k stars 1.97k forks source link

TypeError: "sources is undefined". When serving/building with --aot #745

Closed cmddavid closed 6 years ago

cmddavid commented 6 years ago

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[X ] Bug report  
[ ] Feature request
[ ] Documentation issue or request

What is the current behavior?

I updated an angular app which uses ngrx store and effects from angular 4 to 5. After updating to angular 5 the effects module is giving me errors when using --aot.

I tried finding the answer in this repo and on Google, but I was unable to find anything related.

ng serve is working well, ng serve --aot is giving error

Expected behavior:

both ng serve and ng serve --aot should work

Minimal reproduction of the problem with instructions:

I made an update of my application from angular 4 to 5, and now I'm getting the following errors:

Browser:

 TypeError: sources is undefined
[Meer info]
vendor.bundle.js%20line%20215%20%3E%20eval:390:9
EffectsRootModule
effects.es5.js:363
_callFactory
core.js:10907
_createProviderInstance$1
core.js:10861
initNgModule
core.js:10811
NgModuleRef_
core.js:12066
createNgModuleRef
core.js:12055
debugCreateNgModuleRef
core.js:14389
NgModuleFactory_.prototype.create
core.js:15527
PlatformRef.prototype.bootstrapModuleFactory/<
core.js:5485:58
ZoneDelegate.prototype.invoke
zone.js:388
onInvoke
core.js:4733
ZoneDelegate.prototype.invoke
zone.js:387
Zone.prototype.run
zone.js:138
NgZone.prototype.run
core.js:4550:47
PlatformRef.prototype.bootstrapModuleFactory
core.js:5483
<anoniem>
main.ts:11
../../../../../src/main.ts
http://localhost:4200/main.bundle.js:630:1
__webpack_require__
http://localhost:4200/inline.bundle.js:55:12
[0]
http://localhost:4200/main.bundle.js:645:18
__webpack_require__
http://localhost:4200/inline.bundle.js:55:12
webpackJsonpCallback
http://localhost:4200/inline.bundle.js:26:23
<anoniem>
http://localhost:4200/main.bundle.js:1:1

Terminal:

WARNING in ./src/app/app.module.ngfactory.js
106:14587-14593 "export 'ɵg' (imported as 'i82') was not found in '@ngrx/effects'
    at HarmonyImportSpecifierDependency._getErrors (/Users/aurora/Documents/projects/ps-bitbucket/aurora/node_modules/webpack/lib/dependencies/HarmonyImportSpecifierDependency.js:65:15)
    at HarmonyImportSpecifierDependency.getWarnings (/Users/aurora/Documents/projects/ps-bitbucket/aurora/node_modules/webpack/lib/dependencies/HarmonyImportSpecifierDependency.js:39:15)
    at Compilation.reportDependencyErrorsAndWarnings (/Users/aurora/Documents/projects/ps-bitbucket/aurora/node_modules/webpack/lib/Compilation.js:703:24)
    at Compilation.finish (/Users/aurora/Documents/projects/ps-bitbucket/aurora/node_modules/webpack/lib/Compilation.js:561:9)
    at applyPluginsParallel.err (/Users/aurora/Documents/projects/ps-bitbucket/aurora/node_modules/webpack/lib/Compiler.js:506:17)
    at /Users/aurora/Documents/projects/ps-bitbucket/aurora/node_modules/tapable/lib/Tapable.js:289:11
    at _addModuleChain (/Users/aurora/Documents/projects/ps-bitbucket/aurora/node_modules/webpack/lib/Compilation.js:507:11)
    at processModuleDependencies.err (/Users/aurora/Documents/projects/ps-bitbucket/aurora/node_modules/webpack/lib/Compilation.js:477:14)
    at _combinedTickCallback (internal/process/next_tick.js:95:7)
    at process._tickCallback (internal/process/next_tick.js:161:9)
 @ ./src/app/app.module.ngfactory.js
 @ ./src/main.ts
 @ multi ./src/main.ts

WARNING in ./src/app/app.module.ngfactory.js
106:14621-14627 "export 'ɵh' (imported as 'i82') was not found in '@ngrx/effects'
    at HarmonyImportSpecifierDependency._getErrors (/Users/aurora/Documents/projects/ps-bitbucket/aurora/node_modules/webpack/lib/dependencies/HarmonyImportSpecifierDependency.js:65:15)
    at HarmonyImportSpecifierDependency.getWarnings (/Users/aurora/Documents/projects/ps-bitbucket/aurora/node_modules/webpack/lib/dependencies/HarmonyImportSpecifierDependency.js:39:15)
    at Compilation.reportDependencyErrorsAndWarnings (/Users/aurora/Documents/projects/ps-bitbucket/aurora/node_modules/webpack/lib/Compilation.js:703:24)
    at Compilation.finish (/Users/aurora/Documents/projects/ps-bitbucket/aurora/node_modules/webpack/lib/Compilation.js:561:9)
    at applyPluginsParallel.err (/Users/aurora/Documents/projects/ps-bitbucket/aurora/node_modules/webpack/lib/Compiler.js:506:17)
    at /Users/aurora/Documents/projects/ps-bitbucket/aurora/node_modules/tapable/lib/Tapable.js:289:11
    at _addModuleChain (/Users/aurora/Documents/projects/ps-bitbucket/aurora/node_modules/webpack/lib/Compilation.js:507:11)
    at processModuleDependencies.err (/Users/aurora/Documents/projects/ps-bitbucket/aurora/node_modules/webpack/lib/Compilation.js:477:14)
    at _combinedTickCallback (internal/process/next_tick.js:95:7)
    at process._tickCallback (internal/process/next_tick.js:161:9)
 @ ./src/app/app.module.ngfactory.js
 @ ./src/main.ts
 @ multi ./src/main.ts

WARNING in ./src/app/app.module.ngfactory.js
106:14629-14635 "export 'ɵh' (imported as 'i82') was not found in '@ngrx/effects'
    at HarmonyImportSpecifierDependency._getErrors (/Users/aurora/Documents/projects/ps-bitbucket/aurora/node_modules/webpack/lib/dependencies/HarmonyImportSpecifierDependency.js:65:15)
    at HarmonyImportSpecifierDependency.getWarnings (/Users/aurora/Documents/projects/ps-bitbucket/aurora/node_modules/webpack/lib/dependencies/HarmonyImportSpecifierDependency.js:39:15)
    at Compilation.reportDependencyErrorsAndWarnings (/Users/aurora/Documents/projects/ps-bitbucket/aurora/node_modules/webpack/lib/Compilation.js:703:24)
    at Compilation.finish (/Users/aurora/Documents/projects/ps-bitbucket/aurora/node_modules/webpack/lib/Compilation.js:561:9)
    at applyPluginsParallel.err (/Users/aurora/Documents/projects/ps-bitbucket/aurora/node_modules/webpack/lib/Compiler.js:506:17)
    at /Users/aurora/Documents/projects/ps-bitbucket/aurora/node_modules/tapable/lib/Tapable.js:289:11
    at _addModuleChain (/Users/aurora/Documents/projects/ps-bitbucket/aurora/node_modules/webpack/lib/Compilation.js:507:11)
    at processModuleDependencies.err (/Users/aurora/Documents/projects/ps-bitbucket/aurora/node_modules/webpack/lib/Compilation.js:477:14)
    at _combinedTickCallback (internal/process/next_tick.js:95:7)
    at process._tickCallback (internal/process/next_tick.js:161:9)
 @ ./src/app/app.module.ngfactory.js
 @ ./src/main.ts
 @ multi ./src/main.ts

WARNING in ./src/app/app.module.ngfactory.js
106:14638-14644 "export 'ɵg' (imported as 'i82') was not found in '@ngrx/effects'
    at HarmonyImportSpecifierDependency._getErrors (/Users/aurora/Documents/projects/ps-bitbucket/aurora/node_modules/webpack/lib/dependencies/HarmonyImportSpecifierDependency.js:65:15)
    at HarmonyImportSpecifierDependency.getWarnings (/Users/aurora/Documents/projects/ps-bitbucket/aurora/node_modules/webpack/lib/dependencies/HarmonyImportSpecifierDependency.js:39:15)
    at Compilation.reportDependencyErrorsAndWarnings (/Users/aurora/Documents/projects/ps-bitbucket/aurora/node_modules/webpack/lib/Compilation.js:703:24)
    at Compilation.finish (/Users/aurora/Documents/projects/ps-bitbucket/aurora/node_modules/webpack/lib/Compilation.js:561:9)
    at applyPluginsParallel.err (/Users/aurora/Documents/projects/ps-bitbucket/aurora/node_modules/webpack/lib/Compiler.js:506:17)
    at /Users/aurora/Documents/projects/ps-bitbucket/aurora/node_modules/tapable/lib/Tapable.js:289:11
    at _addModuleChain (/Users/aurora/Documents/projects/ps-bitbucket/aurora/node_modules/webpack/lib/Compilation.js:507:11)
    at processModuleDependencies.err (/Users/aurora/Documents/projects/ps-bitbucket/aurora/node_modules/webpack/lib/Compilation.js:477:14)
    at _combinedTickCallback (internal/process/next_tick.js:95:7)
    at process._tickCallback (internal/process/next_tick.js:161:9)
 @ ./src/app/app.module.ngfactory.js
 @ ./src/main.ts
 @ multi ./src/main.ts

WARNING in ./src/app/app.module.ngfactory.js
106:14700-14706 "export 'ɵh' (imported as 'i82') was not found in '@ngrx/effects'
    at HarmonyImportSpecifierDependency._getErrors (/Users/aurora/Documents/projects/ps-bitbucket/aurora/node_modules/webpack/lib/dependencies/HarmonyImportSpecifierDependency.js:65:15)
    at HarmonyImportSpecifierDependency.getWarnings (/Users/aurora/Documents/projects/ps-bitbucket/aurora/node_modules/webpack/lib/dependencies/HarmonyImportSpecifierDependency.js:39:15)
    at Compilation.reportDependencyErrorsAndWarnings (/Users/aurora/Documents/projects/ps-bitbucket/aurora/node_modules/webpack/lib/Compilation.js:703:24)
    at Compilation.finish (/Users/aurora/Documents/projects/ps-bitbucket/aurora/node_modules/webpack/lib/Compilation.js:561:9)
    at applyPluginsParallel.err (/Users/aurora/Documents/projects/ps-bitbucket/aurora/node_modules/webpack/lib/Compiler.js:506:17)
    at /Users/aurora/Documents/projects/ps-bitbucket/aurora/node_modules/tapable/lib/Tapable.js:289:11
    at _addModuleChain (/Users/aurora/Documents/projects/ps-bitbucket/aurora/node_modules/webpack/lib/Compilation.js:507:11)
    at processModuleDependencies.err (/Users/aurora/Documents/projects/ps-bitbucket/aurora/node_modules/webpack/lib/Compilation.js:477:14)
    at _combinedTickCallback (internal/process/next_tick.js:95:7)
    at process._tickCallback (internal/process/next_tick.js:161:9)
 @ ./src/app/app.module.ngfactory.js
 @ ./src/main.ts
 @ multi ./src/main.ts

WARNING in ./src/app/app.module.ngfactory.js
106:15010-15016 "export 'ɵi' (imported as 'i82') was not found in '@ngrx/effects'
    at HarmonyImportSpecifierDependency._getErrors (/Users/aurora/Documents/projects/ps-bitbucket/aurora/node_modules/webpack/lib/dependencies/HarmonyImportSpecifierDependency.js:65:15)
    at HarmonyImportSpecifierDependency.getWarnings (/Users/aurora/Documents/projects/ps-bitbucket/aurora/node_modules/webpack/lib/dependencies/HarmonyImportSpecifierDependency.js:39:15)
    at Compilation.reportDependencyErrorsAndWarnings (/Users/aurora/Documents/projects/ps-bitbucket/aurora/node_modules/webpack/lib/Compilation.js:703:24)
    at Compilation.finish (/Users/aurora/Documents/projects/ps-bitbucket/aurora/node_modules/webpack/lib/Compilation.js:561:9)
    at applyPluginsParallel.err (/Users/aurora/Documents/projects/ps-bitbucket/aurora/node_modules/webpack/lib/Compiler.js:506:17)
    at /Users/aurora/Documents/projects/ps-bitbucket/aurora/node_modules/tapable/lib/Tapable.js:289:11
    at _addModuleChain (/Users/aurora/Documents/projects/ps-bitbucket/aurora/node_modules/webpack/lib/Compilation.js:507:11)
    at processModuleDependencies.err (/Users/aurora/Documents/projects/ps-bitbucket/aurora/node_modules/webpack/lib/Compilation.js:477:14)
    at _combinedTickCallback (internal/process/next_tick.js:95:7)
    at process._tickCallback (internal/process/next_tick.js:161:9)
 @ ./src/app/app.module.ngfactory.js
 @ ./src/main.ts
 @ multi ./src/main.ts

WARNING in ./src/app/app.module.ngfactory.js
106:15018-15024 "export 'ɵi' (imported as 'i82') was not found in '@ngrx/effects'
    at HarmonyImportSpecifierDependency._getErrors (/Users/aurora/Documents/projects/ps-bitbucket/aurora/node_modules/webpack/lib/dependencies/HarmonyImportSpecifierDependency.js:65:15)
    at HarmonyImportSpecifierDependency.getWarnings (/Users/aurora/Documents/projects/ps-bitbucket/aurora/node_modules/webpack/lib/dependencies/HarmonyImportSpecifierDependency.js:39:15)
    at Compilation.reportDependencyErrorsAndWarnings (/Users/aurora/Documents/projects/ps-bitbucket/aurora/node_modules/webpack/lib/Compilation.js:703:24)
    at Compilation.finish (/Users/aurora/Documents/projects/ps-bitbucket/aurora/node_modules/webpack/lib/Compilation.js:561:9)
    at applyPluginsParallel.err (/Users/aurora/Documents/projects/ps-bitbucket/aurora/node_modules/webpack/lib/Compiler.js:506:17)
    at /Users/aurora/Documents/projects/ps-bitbucket/aurora/node_modules/tapable/lib/Tapable.js:289:11
    at _addModuleChain (/Users/aurora/Documents/projects/ps-bitbucket/aurora/node_modules/webpack/lib/Compilation.js:507:11)
    at processModuleDependencies.err (/Users/aurora/Documents/projects/ps-bitbucket/aurora/node_modules/webpack/lib/Compilation.js:477:14)
    at _combinedTickCallback (internal/process/next_tick.js:95:7)
    at process._tickCallback (internal/process/next_tick.js:161:9)
 @ ./src/app/app.module.ngfactory.js
 @ ./src/main.ts
 @ multi ./src/main.ts

WARNING in ./src/app/app.module.ngfactory.js
106:16573-16579 "export 'ɵi' (imported as 'i82') was not found in '@ngrx/effects'
    at HarmonyImportSpecifierDependency._getErrors (/Users/aurora/Documents/projects/ps-bitbucket/aurora/node_modules/webpack/lib/dependencies/HarmonyImportSpecifierDependency.js:65:15)
    at HarmonyImportSpecifierDependency.getWarnings (/Users/aurora/Documents/projects/ps-bitbucket/aurora/node_modules/webpack/lib/dependencies/HarmonyImportSpecifierDependency.js:39:15)
    at Compilation.reportDependencyErrorsAndWarnings (/Users/aurora/Documents/projects/ps-bitbucket/aurora/node_modules/webpack/lib/Compilation.js:703:24)
    at Compilation.finish (/Users/aurora/Documents/projects/ps-bitbucket/aurora/node_modules/webpack/lib/Compilation.js:561:9)
    at applyPluginsParallel.err (/Users/aurora/Documents/projects/ps-bitbucket/aurora/node_modules/webpack/lib/Compiler.js:506:17)
    at /Users/aurora/Documents/projects/ps-bitbucket/aurora/node_modules/tapable/lib/Tapable.js:289:11
    at _addModuleChain (/Users/aurora/Documents/projects/ps-bitbucket/aurora/node_modules/webpack/lib/Compilation.js:507:11)
    at processModuleDependencies.err (/Users/aurora/Documents/projects/ps-bitbucket/aurora/node_modules/webpack/lib/Compilation.js:477:14)
    at _combinedTickCallback (internal/process/next_tick.js:95:7)
    at process._tickCallback (internal/process/next_tick.js:161:9)
 @ ./src/app/app.module.ngfactory.js
 @ ./src/main.ts
 @ multi ./src/main.ts

Version of affected browser(s),operating system(s), npm, node and ngrx:

I'm working on macOS.

Node version: v8.1.2 NPM version: 5.0.3

This is my package.json:

{
  "name": "vtb",
  "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": {
    "@agm/core": "^1.0.0-beta.2",
    "@angular/animations": "^5.0.0",
    "@angular/common": "^5.0.0",
    "@angular/compiler": "^5.0.0",
    "@angular/core": "^5.0.0",
    "@angular/forms": "^5.0.0",
    "@angular/http": "^5.0.0",
    "@angular/material": "^5.1.0",
    "@angular/platform-browser": "^5.0.0",
    "@angular/platform-browser-dynamic": "^5.0.0",
    "@angular/router": "^5.0.0",
    "@ngrx/core": "^1.2.0",
    "@ngrx/effects": "^5.0.0",
    "@ngrx/store": "^5.0.0",
    "angular2-jwt": "^0.2.3",
    "angular2-material-datepicker": "^0.5.0",
    "core-js": "^2.4.1",
    "dragula": "^3.7.2",
    "ng2-ckeditor": "^1.1.14",
    "ng2-dragula": "^1.5.0",
    "ng2-page-scroll": "^4.0.0-beta.12",
    "node-sass": "^4.7.2",
    "rxjs": "^5.5.2",
    "zone.js": "^0.8.14"
  },
  "devDependencies": {
    "@angular-devkit/core": "0.0.28",
    "@angular/cli": "1.5.0",
    "@angular/compiler-cli": "^5.0.0",
    "@angular/language-service": "^5.0.0",
    "@types/jasmine": "~2.5.53",
    "@types/jasminewd2": "~2.0.2",
    "@types/node": "~6.0.60",
    "codelyzer": "~3.2.0",
    "jasmine-core": "~2.6.2",
    "jasmine-spec-reporter": "~4.1.0",
    "karma": "~1.7.0",
    "karma-chrome-launcher": "~2.1.1",
    "karma-cli": "~1.0.1",
    "karma-coverage-istanbul-reporter": "^1.2.1",
    "karma-jasmine": "~1.1.0",
    "karma-jasmine-html-reporter": "^0.2.2",
    "protractor": "~5.1.2",
    "ts-node": "~3.2.0",
    "tslint": "~5.7.0",
    "typescript": "~2.4.2"
  }
}

Other information:

I'm using ngrx combined with other angular 5 projects just fine. So I'm really surprised to suddenly have this problem. I'm hoping all this debugging info can somehow help to find the problem.

brandonroberts commented 6 years ago

An action reproduction would help is diagnosing this issue.

cmddavid commented 6 years ago

I'm on it, problem is everything is working fine when I add the same packages and ngrx related code to a new project.

MikeRyanDev commented 6 years ago

@cmddavid Feel free to open a new issue if this is still a problem and you can reproduce it.