You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Yup that was the issue I was looking for. I will be speaking with a few folks from Chrome next week (in the context of that issue and other stuff). I'll make sure to keep track of this and update accordingly.
@TheLarkInn Does not look like this issue is resolved. I have seen the commit #1659 . I took the latest master and created a new project added material2. Now ng serve is failing.
If I change to 'cheap-module-source-map' from 'source-map', ng serve is OK, but debugging does not work.
ng serve throws the following error with latest master. I see the same error even on osx
TypeError: Cannot read property 'substr' of undefined
at Function. (C:\Projects\angular-cli\node_modules\webpack-sources\node_modules\source-map\lib\source-node.js:95:30)
at Array.forEach (native)
at SourceMapConsumer_eachMapping as eachMapping
at Function.SourceNode_fromStringWithSourceMap as fromStringWithSourceMap
at SourceMapSource.node (C:\Projects\angular-cli\node_modules\webpack-sources\lib\SourceMapSource.js:42:20)
at ReplaceSource.node (C:\Projects\angular-cli\node_modules\webpack-sources\lib\ReplaceSource.js:66:29)
at CachedSource.node (C:\Projects\angular-cli\node_modules\webpack-sources\lib\CachedSource.js:12:23)
at C:\Projects\angular-cli\node_modules\webpack-sources\lib\ConcatSource.js:40:49
at Array.map (native)
at ConcatSource.node (C:\Projects\angular-cli\node_modules\webpack-sources\lib\ConcatSource.js:39:60)
at C:\Projects\angular-cli\node_modules\webpack-sources\lib\ConcatSource.js:40:49
at Array.map (native)
at ConcatSource.node (C:\Projects\angular-cli\node_modules\webpack-sources\lib\ConcatSource.js:39:60)
at C:\Projects\angular-cli\node_modules\webpack-sources\lib\ConcatSource.js:40:49
at Array.map (native)
at ConcatSource.node (C:\Projects\angular-cli\node_modules\webpack-sources\lib\ConcatSource.js:39:60)
at C:\Projects\angular-cli\node_modules\webpack-sources\lib\ConcatSource.js:40:49
at Array.map (native)
at ConcatSource.node (C:\Projects\angular-cli\node_modules\webpack-sources\lib\ConcatSource.js:39:60)
at ConcatSource.proto.sourceAndMap (C:\Projects\angular-cli\node_modules\webpack-sources\lib\SourceAndMapMixin.js:28:18)
at CachedSource.sourceAndMap (C:\Projects\angular-cli\node_modules\webpack-sources\lib\CachedSource.js:51:28)
at Compilation. (C:\Projects\angular-cli\node_modules\webpack\lib\SourceMapDevToolPlugin.js:57:32)
Source maps are working after your commit @TheLarkInn at least at my place.
Here they are working again in Firefox and Chrome an IE. Before it wasn't working in the 3 Browsers.
@masaanli any chance you can try the repo I mentioned in the previous comments. It would be good to if it is just me. I tried in on both my windows and Mac
@mmrath I have got the same
Cannot read property 'substr' of undefined
error with your repository, and it is appears with material2
Without material2, "ng serve" works properly.
Also, not all of material2 modules trigger this error. If you import just some of them project will compile.
Also, source maps are wrong with ng2-bootstrap v1.0.24
May be this is an issue with precompiled source maps in some material2 and ng2-bootstrap modules.
Or with the way of handling these maps by angular cli
@mmrath it took me a while to get back to this, apologies. I tried with the latest angular-cli@webpack and angular2-material@alpha.8-1 and I got no errors.
I think this was due to buggy source maps on these libs before. For instance, a while ago all the sourcemaps the CLI generated were themselves broken. In this case, the best we can do is to ignore them since it broken sourcemaps there is no way to accurately debug the source.
I don't know whether it has the same cause but source maps are not working in my project either. I'm using angular-cli@1.0.0-beta.18 and @angular/material@2.0.0-alpha.9-3
I also have this problem running angular-cli 1.0.0-beta.24. It only occurs when running ng serve or ng build in a Docker container, though. Workaround is to disable sourcemaps (--no-sourcemap).
For docker users. Are your node_modules being shared from the host machine? there may be an issue with how docker follows the sym-links in your mounted directories. Look into installing node_modules with --no-bin-links
angular-automatic-lock-bot commented on Sep 6, 2019
Activity
filipesilva commentedon Jul 29, 2016
@TheLarkInn should your sourcemap solution have fixed this scenario?
TheLarkInn commentedon Jul 29, 2016
This is a chrome issue I believe @mmrath can you do me a favor and try this in Chrome Canary just to make sure it's the issue I believe it is.
mmrath commentedon Jul 30, 2016
@TheLarkInn I tried it in Chrome Canary, the behaviour is same. It still does not work.
Update: Chrome Version 54.0.2811.2 canary (64-bit)
mmrath commentedon Jul 30, 2016
This could be related to webpack/webpack#2145
TheLarkInn commentedon Jul 30, 2016
Yup that was the issue I was looking for. I will be speaking with a few folks from Chrome next week (in the context of that issue and other stuff). I'll make sure to keep track of this and update accordingly.
masaanli commentedon Aug 2, 2016
I can confirm this, having the same issue.
It only debugs if i add a debugger; in my code ;)
mmrath commentedon Aug 16, 2016
@TheLarkInn Does not look like this issue is resolved. I have seen the commit #1659 . I took the latest master and created a new project added material2. Now ng serve is failing.
If I change to
'cheap-module-source-map'from'source-map',ng serveis OK, but debugging does not work.Sample repo to reproduce is at https://github.com/mmrath/test-cli-source-map.git
ng servethrows the following error with latest master. I see the same error even on osxTypeError: Cannot read property 'substr' of undefined
at Function. (C:\Projects\angular-cli\node_modules\webpack-sources\node_modules\source-map\lib\source-node.js:95:30)
at Array.forEach (native)
at SourceMapConsumer_eachMapping as eachMapping
at Function.SourceNode_fromStringWithSourceMap as fromStringWithSourceMap
at SourceMapSource.node (C:\Projects\angular-cli\node_modules\webpack-sources\lib\SourceMapSource.js:42:20)
at ReplaceSource.node (C:\Projects\angular-cli\node_modules\webpack-sources\lib\ReplaceSource.js:66:29)
at CachedSource.node (C:\Projects\angular-cli\node_modules\webpack-sources\lib\CachedSource.js:12:23)
at C:\Projects\angular-cli\node_modules\webpack-sources\lib\ConcatSource.js:40:49
at Array.map (native)
at ConcatSource.node (C:\Projects\angular-cli\node_modules\webpack-sources\lib\ConcatSource.js:39:60)
at C:\Projects\angular-cli\node_modules\webpack-sources\lib\ConcatSource.js:40:49
at Array.map (native)
at ConcatSource.node (C:\Projects\angular-cli\node_modules\webpack-sources\lib\ConcatSource.js:39:60)
at C:\Projects\angular-cli\node_modules\webpack-sources\lib\ConcatSource.js:40:49
at Array.map (native)
at ConcatSource.node (C:\Projects\angular-cli\node_modules\webpack-sources\lib\ConcatSource.js:39:60)
at C:\Projects\angular-cli\node_modules\webpack-sources\lib\ConcatSource.js:40:49
at Array.map (native)
at ConcatSource.node (C:\Projects\angular-cli\node_modules\webpack-sources\lib\ConcatSource.js:39:60)
at ConcatSource.proto.sourceAndMap (C:\Projects\angular-cli\node_modules\webpack-sources\lib\SourceAndMapMixin.js:28:18)
at CachedSource.sourceAndMap (C:\Projects\angular-cli\node_modules\webpack-sources\lib\CachedSource.js:51:28)
at Compilation. (C:\Projects\angular-cli\node_modules\webpack\lib\SourceMapDevToolPlugin.js:57:32)
masaanli commentedon Aug 16, 2016
Source maps are working after your commit @TheLarkInn at least at my place.
Here they are working again in Firefox and Chrome an IE. Before it wasn't working in the 3 Browsers.
mmrath commentedon Aug 16, 2016
@masaanli any chance you can try the repo I mentioned in the previous comments. It would be good to if it is just me. I tried in on both my windows and Mac
filipesilva commentedon Aug 22, 2016
Reopening to investigate @mmrath's report.
ValeryVS commentedon Aug 26, 2016
@mmrath I have got the same
Cannot read property 'substr' of undefined
error with your repository, and it is appears with material2
Without material2, "ng serve" works properly.
Also, not all of material2 modules trigger this error. If you import just some of them project will compile.
Also, source maps are wrong with ng2-bootstrap v1.0.24
But @ng-bootstrap/ng-bootstrap 1.0.0-alpha.2 works well.
ValeryVS commentedon Aug 26, 2016
May be this is an issue with precompiled source maps in some material2 and ng2-bootstrap modules.
Or with the way of handling these maps by angular cli
filipesilva commentedon Sep 12, 2016
@mmrath it took me a while to get back to this, apologies. I tried with the latest
angular-cli@webpackandangular2-material@alpha.8-1and I got no errors.I think this was due to buggy source maps on these libs before. For instance, a while ago all the sourcemaps the CLI generated were themselves broken. In this case, the best we can do is to ignore them since it broken sourcemaps there is no way to accurately debug the source.
dancancro commentedon Nov 11, 2016
I don't know whether it has the same cause but source maps are not working in my project either. I'm using angular-cli@1.0.0-beta.18 and @angular/material@2.0.0-alpha.9-3
filipesilva commentedon Nov 12, 2016
@dancancro there was a regression in beta.18 with sourcemaps, upgrading to beta.19-3 should fix it.
dancancro commentedon Nov 13, 2016
Thank you. It looks like that fixed it.
doliver3 commentedon Nov 23, 2016
This error is occurring in "angular-cli": "1.0.0-beta.21"
filipesilva commentedon Dec 22, 2016
@doliver3 can you tell me how you repro'd it?
jstaffans commentedon Jan 10, 2017
I also have this problem running angular-cli 1.0.0-beta.24. It only occurs when running
ng serveorng buildin a Docker container, though. Workaround is to disable sourcemaps (--no-sourcemap).JSMike commentedon Jan 12, 2017
For docker users. Are your node_modules being shared from the host machine? there may be an issue with how docker follows the sym-links in your mounted directories. Look into installing node_modules with --no-bin-links
angular-automatic-lock-bot commentedon Sep 6, 2019
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.