Skip to content

ng build chokes on processing Angular source maps #5476

@IgorMinar

Description

@IgorMinar

Bug Report or Feature Request (mark with an x)

  • bug report -> please search issues before submitting

Versions.

@angular/cli: 1.0.0-rc.2
node: 6.9.5
os: darwin x64
@angular/animations: 4.0.0-rc.4
@angular/common: 4.0.0-rc.4
@angular/compiler: 4.0.0-rc.4
@angular/core: 4.0.0-rc.4
@angular/forms: 4.0.0-rc.4
@angular/http: 4.0.0-rc.4
@angular/material: 2.0.0-beta.2
@angular/platform-browser: 4.0.0-rc.4
@angular/platform-browser-dynamic: 4.0.0-rc.4
@angular/platform-server: 4.0.0-rc.4
@angular/router: 4.0.0-rc.4
@angular/service-worker: 1.0.0-beta.7
@angular/cli: 1.0.0-rc.2
@angular/compiler-cli: 4.0.0-rc.2

Repro steps.

  1. upgrade a project to angular 4.0.0-rc.4
  2. modify node_modules/@angular/cli//models/webpack-configs/common.js to no exclude node_modules from the source-map-loader
  3. build the project with ng build or ng build --prod --sm

The log given by the failure.

$ ng build --prod --sm
 92% chunk asset optimization/Users/iminar/Dev/angular/aio/node_modules/source-map/lib/source-node.js:95
          var code = nextLine.substr(0, mapping.generatedColumn -
                             ^

TypeError: Cannot read property 'substr' of undefined
    at Function.<anonymous> (/Users/iminar/Dev/angular/aio/node_modules/source-map/lib/source-node.js:95:30)
    at Array.forEach (native)
    at SourceMapConsumer_eachMapping [as eachMapping] (/Users/iminar/Dev/angular/aio/node_modules/source-map/lib/source-map-consumer.js:155:14)
    at Function.SourceNode_fromStringWithSourceMap [as fromStringWithSourceMap] (/Users/iminar/Dev/angular/aio/node_modules/source-map/lib/source-node.js:80:24)
    at SourceMapSource.node (/Users/iminar/Dev/angular/aio/node_modules/webpack-sources/lib/SourceMapSource.js:42:20)
    at ReplaceSource.node (/Users/iminar/Dev/angular/aio/node_modules/webpack-sources/lib/ReplaceSource.js:69:29)
    at CachedSource.node (/Users/iminar/Dev/angular/aio/node_modules/webpack-sources/lib/CachedSource.js:12:23)
    at /Users/iminar/Dev/angular/aio/node_modules/webpack-sources/lib/ConcatSource.js:40:49
    at Array.map (native)
    at ConcatSource.node (/Users/iminar/Dev/angular/aio/node_modules/webpack-sources/lib/ConcatSource.js:39:60)
    at /Users/iminar/Dev/angular/aio/node_modules/webpack-sources/lib/ConcatSource.js:40:49
    at Array.map (native)
    at ConcatSource.node (/Users/iminar/Dev/angular/aio/node_modules/webpack-sources/lib/ConcatSource.js:39:60)
    at /Users/iminar/Dev/angular/aio/node_modules/webpack-sources/lib/ConcatSource.js:40:49
    at Array.map (native)
    at ConcatSource.node (/Users/iminar/Dev/angular/aio/node_modules/webpack-sources/lib/ConcatSource.js:39:60)

Desired functionality.

should build 😄

Mention any other details that might be useful.

Metadata

Metadata

Assignees

Labels

P1Impacts a large percentage of users; if a workaround exists it is partial or overly painfultype: bug/fix

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions