fknop / angular-pipes

Useful pipes for Angular
https://fknop.gitbook.io/angular-pipes/
MIT License
732 stars 157 forks source link

AOT compilation fails #34

Closed aegyed91 closed 7 years ago

aegyed91 commented 7 years ago

@fknop something is not working with AOT again, and the error message isn't telling me much

Here is a useful comment that might help https://github.com/dougludlow/ng2-bs3-modal/issues/105#issuecomment-247388992

Error: Unexpected value 'NgPipesModule' imported by the module 'AppM'
    at /workspace/vivien/frontend/node_modules/@angular/compiler/bundles/compiler.umd.js:17710:46
    at Array.forEach (native)
    at CompileMetadataResolver.getNgModuleMetadata (/workspace/vivien/frontend/node_modules/@angular/compiler/bundles/compiler.umd.js:17695:51)
    at addNgModule (/workspace/vivien/frontend/node_modules/@angular/compiler/bundles/compiler.umd.js:24285:60)
    at /workspace/vivien/frontend/node_modules/@angular/compiler/bundles/compiler.umd.js:24296:16
    at Array.forEach (native)
    at _createNgModules (/workspace/vivien/frontend/node_modules/@angular/compiler/bundles/compiler.umd.js:24295:28)
    at analyzeNgModules (/workspace/vivien/frontend/node_modules/@angular/compiler/bundles/compiler.umd.js:24174:16)
    at analyzeAndValidateNgModules (/workspace/vivien/frontend/node_modules/@angular/compiler/bundles/compiler.umd.js:24184:37)
    at AotCompiler.compileAll (/workspace/vivien/frontend/node_modules/@angular/compiler/bundles/compiler.umd.js:23923:20)
Compilation failed
fknop commented 7 years ago

What version of ngc are you using ? I tried a few days ago I didn't have any issues.

aegyed91 commented 7 years ago

"@angular/compiler": "2.3.0", "@angular/compiler-cli": "2.3.0",

fknop commented 7 years ago

Can you try with 2.3.1 ?

aegyed91 commented 7 years ago

Got the same result with (double checked the node_module to make sure npm isnt loading the cached version):

    "@angular/common": "^2.3.1",
    "@angular/compiler": "^2.3.1",
    "@angular/compiler-cli": "^2.3.1",
    "@angular/core": "^2.3.1",
    "@angular/forms": "^2.3.1",
    "@angular/http": "^2.3.1",
    "@angular/platform-browser": "2.3.1",
    "@angular/platform-browser-dynamic": "2.3.1",
    "@angular/router": "3.3.1",
    "@angular/tsc-wrapped": "^0.5.0",
    "angular-pipes": "^5.5.0",

I think the error is caused because the lack of a metadata.json file, https://github.com/dougludlow/ng2-bs3-modal/issues/105#issuecomment-247388992. But not sure are all.

Is it working on your side?

fknop commented 7 years ago

Did it work with the previous versions ? 5.4.0 or 5.3.0 ?

aegyed91 commented 7 years ago

I dont know, havent tried it for a long time.

fknop commented 7 years ago

I'm busy I won't be able to try it today. If not tonight, I'll try tomorrow.

aegyed91 commented 7 years ago

Alright, if i get to the end of my tasks today and still got some time left from work time ill try to fix it as well

aegyed91 commented 7 years ago

Btw it seems you also generate the metadata files from what ngc feeds from.

Also compared your build files to some other ng2 modules i use. The only difference i recognized is: only ur files contains index.suffix.extension. No other project uses index files. Maybe this doesnt matter at all, maybe it does. (some weird module resolution option)

It is not much help i know. :dancer:

fknop commented 7 years ago

Just tried, it compiles with ngc 2.3.1 and angular-pipes 5.5.0

aegyed91 commented 7 years ago

I wanted to create a reproduction repo but the aot compilation ran down perfectly there.

It is really weird why i keep getting Unexpected value 'NgPipesModule' imported by the module 'AppM', will further debug it. Sorry for tripping you with a non-existed issue.

fknop commented 7 years ago

No problem.

Check this comment. https://github.com/angular/angular/issues/11438#issuecomment-245576901. I remember having the issue, but it was in JIT mode.