Skip to content

code from source-map-loader is possibly ending up in the bundle #22998

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

Closed
1 of 15 tasks
chrisguttandin opened this issue Apr 17, 2022 · 3 comments · Fixed by #23063
Closed
1 of 15 tasks

code from source-map-loader is possibly ending up in the bundle #22998

chrisguttandin opened this issue Apr 17, 2022 · 3 comments · Fixed by #23063

Comments

@chrisguttandin
Copy link
Contributor

🐞 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?

Yes, the previous version in which this bug was not present was: v12.x

Description

Producing a production bundle with enabled source maps causes the source-map-loader package itself to appear in the bundle. I think this is rather confusing since source-map-loader is a webpack loader which should only be used at build time.

I'm not sure though if some code of source-map-loader actually ends up in the bundle or the source maps are just wrongly pointing to it. Interestingly source-map-loader is not part of the source maps anymore with optimization turned off.

🔬 Minimal Reproduction

npx @angular/cli new example
cd example/
ng build --source-map

🔥 Exception or Error

The main.hash.js.map file has a reference to "./node_modules/source-map-loader/dist/cjs.js".

🌍 Your Environment


Angular CLI: 13.3.3
Node: 16.14.2
Package Manager: npm 8.5.2
OS: darwin arm64

Angular: 13.3.3
... animations, cli, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1303.3
@angular-devkit/build-angular   13.3.3
@angular-devkit/core            13.3.3
@angular-devkit/schematics      13.3.3
@schematics/angular             13.3.3
rxjs                            7.5.5
typescript                      4.6.3

Anything else relevant?

Running ng build with disabled optimization (ng build --source-map --optimization=false) will produce source maps which don't include a reference to the source-map-loader package.

@clydin clydin added the needs: investigation Requires some digging to determine if action is needed label Apr 18, 2022
@alan-agius4 alan-agius4 self-assigned this May 2, 2022
@alan-agius4 alan-agius4 added type: bug/fix freq1: low Only reported by a handful of users who observe it rarely severity5: regression area: @angular-devkit/build-angular devkit/build-angular:browser and removed needs: investigation Requires some digging to determine if action is needed labels May 2, 2022
@ngbot ngbot bot modified the milestone: Backlog May 2, 2022
@alan-agius4
Copy link
Collaborator

Closed via #23063

@chrisguttandin
Copy link
Contributor Author

Thanks a lot for addressing this, @alan-agius4. 🙏

@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 Jun 4, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants