1.7.0 wont prod build: cannot read property line of undefined
See original GitHub issueSmall dependencies problem I guess.
Versions
Angular CLI: 1.7.0-beta.1
Node: 8.9.4
OS: darwin x64
Angular: 5.2.0
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router
@angular/cli: 1.7.0-beta.1
@angular-devkit/build-optimizer: 0.0.41
@angular-devkit/core: 0.0.28
@angular-devkit/schematics: 0.0.51
@ngtools/json-schema: 1.1.0
@ngtools/webpack: 1.10.0-beta.1
@schematics/angular: 0.1.16
typescript: 2.5.3
webpack-bundle-analyzer: 2.9.2
webpack: 3.10.0
Repro steps
- Fresh project using CLI
v1.7.0-beta.1
ng build --prod
Observed behavior
The code won’t compile at all. An error in modules.
/project/node_modules/clean-css/lib/reader/input-source-map-tracker.js:37
if (originalPosition.line === null && line > 1 && selectorFallbacks > 0) {
^
TypeError: Cannot read property 'line' of undefined
at originalPositionFor (/project/node_modules/clean-css/lib/reader/input-source-map-tracker.js:37:24)
at originalMetadata (/project/node_modules/clean-css/lib/tokenizer/tokenize.js:486:43)
at intoTokens (/project/node_modules/clean-css/lib/tokenizer/tokenize.js:435:68)
at tokenize (/project/node_modules/clean-css/lib/tokenizer/tokenize.js:74:10)
at fromStyles (/project/node_modules/clean-css/lib/reader/read-sources.js:147:12)
at fromString (/project/node_modules/clean-css/lib/reader/read-sources.js:48:10)
at doReadSources (/project/node_modules/clean-css/lib/reader/read-sources.js:33:12)
at readSources (/project/node_modules/clean-css/lib/reader/read-sources.js:24:10)
at /project/node_modules/clean-css/lib/clean.js:99:12
at _combinedTickCallback (internal/process/next_tick.js:131:7)
at process._tickCallback (internal/process/next_tick.js:180:9)
Mention any other details that might be useful
Tried to delete package-lock.json
, delete node_modules, fresh reinstall. Same problem. Also tried yarn with no success.
Reverting to previous version make the error disappear.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:10
- Comments:44 (3 by maintainers)
Top Results From Across the Web
ERROR in Cannot read property '0' of undefined after upgrade ...
I had the exact same error. In my case the issue was incorrect import paths. I moved one folder to a different path...
Read more >[SOLVED] Error at production build step with bundle-visualizer ...
[SOLVED] Error at production build step with bundle-visualizer: unknown: Cannot read property 'add' of undefined while minifying.
Read more >How to Avoid the Infamous "Cannot read properties of ... - Bitovi
That error message is telling you the function is returning undefined implicitly, but its return type does not include undefined in it. Awesome!...
Read more >cannot read properties of undefined angular - You.com
The problem is that as an Input variable, the reminders object is initially undefined until angular has finished initializing the component. See this...
Read more >Changelog - Cypress Documentation
You can use your favorite Cypress commands and features to develop your ... the error "cannot read property split of undefined" in certain...
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
We have updated our dependency to
clean-css@4.1.11
meanwhile, but for those still affected you can do this:Installing and uninstalling should force the package manager to use the newer one and dedupe it. This is generally useful when you want to force your project to use a certain version of an indirect dependency, and better than just deleting your node_modules and package lock.
@jamieathans how do you lint this??
I have same problem with materialize-css (using dist/css), on
ng build