Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Building project with sourcemaps fails #11118

Closed
miguskar opened this issue Jun 5, 2018 · 2 comments
Closed

Building project with sourcemaps fails #11118

miguskar opened this issue Jun 5, 2018 · 2 comments

Comments

@miguskar
Copy link

miguskar commented Jun 5, 2018

Versions

OS: macOS (High Sierra)

Angular CLI: 6.0.1
Node: 8.11.2
NPM: 6.0.1
OS: darwin x64
Angular: 6.0.2
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.6.1
@angular-devkit/build-angular     0.6.1
@angular-devkit/build-optimizer   0.6.1
@angular-devkit/core              0.6.1
@angular-devkit/schematics        0.6.1
@angular/cli                      6.0.1
@ngtools/webpack                  6.0.1
@schematics/angular               0.6.1
@schematics/update                0.6.1
rxjs                              6.1.0
typescript                        2.7.2
webpack                           4.6.0

Repro steps

Example repository is an app with an external dependency sweetalert2
Example repo: https://github.com/miguskar/ng-example-app
Stackblitz of same repo: https://stackblitz.com/github/miguskar/ng-example-app

  • Step 1: npm i
  • Step 2: npm run build:sm // build with source maps

Observed behavior

An external JS package (sweetalert2) is breaking the build when building the app with sourcemaps enabled.

> ng-example-app@0.0.0 build:sm /Users/mk/normative/stuff/ng-example-app
> ng build --configuration=production


Date: 2018-06-05T15:00:03.012Z
Hash: 81614cde42c2e965fae1
Time: 16808ms
chunk {0} runtime.6afe30102d8fe7337431.js, runtime.6afe30102d8fe7337431.js.map (runtime) 1.11 kB [entry] [rendered]
chunk {1} styles.5a8b98837357f6c30e89.css, styles.5a8b98837357f6c30e89.css.map (styles) 59 bytes [initial] [rendered]
chunk {2} polyfills.e7992d098ebc20f9d82d.js, polyfills.e7992d098ebc20f9d82d.js.map (polyfills) 59.6 kB [initial] [rendered]
chunk {3} main.e04b8612bc19d2ceb29b.js, main.e04b8612bc19d2ceb29b.js.map (main) 237 kB [initial] [rendered]

ERROR in ./node_modules/sweetalert2/dist/sweetalert2.all.js
Module build failed: RangeError: Maximum call stack size exceeded
    at skipSourceTrivia (/Users/mk/normative/stuff/ng-example-app/node_modules/typescript/lib/typescript.js:68075:34)
    at emitNodeWithSourceMap (/Users/mk/normative/stuff/ng-example-app/node_modules/typescript/lib/typescript.js:68269:29)
    at pipelineEmitWithSourceMap (/Users/mk/normative/stuff/ng-example-app/node_modules/typescript/lib/typescript.js:70981:17)
    at emitNodeWithNestedComments (/Users/mk/normative/stuff/ng-example-app/node_modules/typescript/lib/typescript.js:68568:17)
    at emitNodeWithSynthesizedComments (/Users/mk/normative/stuff/ng-example-app/node_modules/typescript/lib/typescript.js:68518:13)
    at emitNodeWithComments (/Users/mk/normative/stuff/ng-example-app/node_modules/typescript/lib/typescript.js:68488:21)
    at pipelineEmitWithComments (/Users/mk/normative/stuff/ng-example-app/node_modules/typescript/lib/typescript.js:70973:17)
    at emitNodeWithNotification (/Users/mk/normative/stuff/ng-example-app/node_modules/typescript/lib/typescript.js:67902:21)
    at pipelineEmitWithNotification (/Users/mk/normative/stuff/ng-example-app/node_modules/typescript/lib/typescript.js:70964:17)
    at emitExpression (/Users/mk/normative/stuff/ng-example-app/node_modules/typescript/lib/typescript.js:70960:13)
    at emitBinaryExpression (/Users/mk/normative/stuff/ng-example-app/node_modules/typescript/lib/typescript.js:71846:13)
    at pipelineEmitExpression (/Users/mk/normative/stuff/ng-example-app/node_modules/typescript/lib/typescript.js:71317:28)
    at pipelineEmitWithHint (/Users/mk/normative/stuff/ng-example-app/node_modules/typescript/lib/typescript.js:70991:49)
    at emitNodeWithSourceMap (/Users/mk/normative/stuff/ng-example-app/node_modules/typescript/lib/typescript.js:68279:21)
    at pipelineEmitWithSourceMap (/Users/mk/normative/stuff/ng-example-app/node_modules/typescript/lib/typescript.js:70981:17)
    at emitNodeWithNestedComments (/Users/mk/normative/stuff/ng-example-app/node_modules/typescript/lib/typescript.js:68568:17)

Desired behavior

The build should finish without error

Mention any other details that might be useful (optional)

Building the same project without sourcemaps works fine (ng build --configuration=production --sourceMap=false)

@filipesilva
Copy link
Contributor

This is a duplicate of #9636 and should be fixed in @angular-devkit/build-angular@0.7.0-beta.2. See angular/devkit#998 for some more information about this problem.

@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 8, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants