angular-cli: Locally linked UMD bundles break runtime when producing source maps
π Bug report
Command (mark with an x
)
- new
- build
- serve
- test
- e2e
- generate
- add
- update
- lint
- extract-i18n
- run
- config
- help
- version
- doc
Is this a regression?
Description
List a local js/umd
built package in the package.json
and run npm i
so it creates a symbolic link in node_modules
and not a copy.
Causes chunks to be generated with undefinedundefinedundefinedundefined
inserted into the bottom of the build output which obviously break the whole thing on runtime.
Workarounds
-
Disable source map generation (i.e production mode)
-
(Best option)
npm pack
the module and list the tar in thepackage.json
instead so that the module is copied and not linked. -
Other fix (by far not recommended):
// adding vendorSourceMap in @angular-devkit/build-angular/src/webpack/configs/common.js fixes it
if ((scriptsSourceMap || stylesSourceMap) && vendorSourceMap) {
// --- OR ---
// add the origin folder (in this case 'vendor') to exclude regex
exclude: vendorSourceMap
? /(ngfactory|ngstyle)\.js$/
: [/[\\\/]node_modules[\\\/]/, /[\\\/]vendor[\\\/]/, /(ngfactory|ngstyle)\.js$/],
π¬ Minimal Reproduction
Apart from a zoom call, canβt really reproduce as itβs a purchased commercial module in use.
π₯ Exception or Error
π Your Environment
Anything else relevant?
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 28
@alan-agius4 You can email me directly and Iβll provide access to our UMD build. mats at bryntum dot com