Closed jeffmath closed 5 years ago
I should mention that I really like the benefits that ngx-take-until-destroy provides, and am thankful that you created it.
Switched to ng-packger. Everything should be standard now. (v5.2.0)
5.2.1
I get this error now when running an ng build -prod
using 5.2.1:
ERROR in ./src/main.ts
Module not found: Error: Can't resolve './$$_gendir/app/app.module.ngfactory' in 'C:\Users\Jeff\KBRA\Spectre\spectre-ui\src'
ERROR in Error: Metadata version mismatch for module C:/Users/Jeff/KBRA/Spectre/spectre-ui/node_modules/ngx-take-until-destroy/ngx-take-until-destroy.d.ts, found version 4, expected 3
at StaticSymbolResolver.getModuleMetadata (C:\Users\Jeff\KBRA\Spectre\spectre-ui\node_modules\@angular\compiler\bundles\compiler.umd.js:25616:34)
at StaticSymbolResolver._createSymbolsOf (C:\Users\Jeff\KBRA\Spectre\spectre-ui\node_modules\@angular\compiler\bundles\compiler.umd.js:25404:46)
at StaticSymbolResolver.getSymbolsOf (C:\Users\Jeff\KBRA\Spectre\spectre-ui\node_modules\@angular\compiler\bundles\compiler.umd.js:25385:14)
at C:\Users\Jeff\KBRA\Spectre\spectre-ui\node_modules\@angular\compiler\bundles\compiler.umd.js:24241:30
at Array.forEach (<anonymous>)
at extractProgramSymbols (C:\Users\Jeff\KBRA\Spectre\spectre-ui\node_modules\@angular\compiler\bundles\compiler.umd.js:24240:79)
at AotCompiler.analyzeModulesAsync (C:\Users\Jeff\KBRA\Spectre\spectre-ui\node_modules\@angular\compiler\bundles\compiler.umd.js:23796:47)
at CodeGenerator.codegen (C:\Users\Jeff\KBRA\Spectre\spectre-ui\node_modules\@angular\compiler-cli\src\codegen.js:32:14)
at Function.NgTools_InternalApi_NG_2.codeGen (C:\Users\Jeff\KBRA\Spectre\spectre-ui\node_modules\@angular\compiler-cli\src\ngtools_api.js:73:30)
at _donePromise.Promise.resolve.then (C:\Users\Jeff\KBRA\Spectre\spectre-ui\node_modules\@ngtools\webpack\src\plugin.js:430:58)
at process._tickCallback (internal/process/next_tick.js:68:7)
at Function.Module.runMain (internal/modules/cjs/loader.js:745:11)
at startup (internal/bootstrap/node.js:266:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:596:3)
A non-prod build works fine.
Changing the "version"
value in ngx-take-until-destroy.metadata.json
from 4 to 3 fixes the error in the prod build. I'm not sure if that is the right way to fix it, though.
I can't reproduce this. Can you try delete node modules and re-install it?
I tried your suggestion but am still getting the same error for the prod build.
Oh, it's because you are on v5.
Try v5.2.2, please.
5.2.2 fixes the problem with the prod build. Thank you!
In my project which employs Babel, Jest tests which passed before I started using your package are now failing with a message indicating that the code from your package is not plain JavaScript. In your
package.json
, themodule
field is set to"dist/es5/index.js"
, which I believe uses CommonJS modules, whilemain
is set to"dist/index.js"
, which employs standard JavaScript modules. Reading this proposal describing how themodule
field allows opt-in use of standard JavaScript modules (while still providing access to CommonJS modules throughmain
), I feel that these two field values should be switched. And indeed, when I switch them, my tests pass again.