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

Since v1.2.2, running ng test with source maps enabled (default) makes some bundles be loaded two times more through XHR under Chrome only #7525

Closed
1 of 2 tasks
ymeine opened this issue Aug 28, 2017 · 4 comments
Labels
needs: investigation Requires some digging to determine if action is needed P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent severity1: confusing type: bug/fix

Comments

@ymeine
Copy link

ymeine commented Aug 28, 2017

Bug Report or Feature Request (mark with an x)

  • bug report -> please search issues before submitting
  • feature request

Versions.

@angular/cli: 1.3.1
node: 8.4.0
os: win32 x64
@angular/animations: 4.3.5
@angular/common: 4.3.5
@angular/compiler: 4.3.5
@angular/core: 4.3.5
@angular/forms: 4.3.5
@angular/http: 4.3.5
@angular/platform-browser: 4.3.5
@angular/platform-browser-dynamic: 4.3.5
@angular/router: 4.3.5
@angular/cli: 1.3.1
@angular/compiler-cli: 4.3.5
@angular/language-service: 4.3.5

Repro steps.

To reproduce the issue, run ng test on a project freshly generated by the CLI and make sure --sourcemap is enabled and that you are testing it with Chrome. Then open the developer tools and check the network panel.

The following files are all loaded three times (once through a script inclusion and then twice through XHR):

  • inline.bundle.js
  • vendor.bundle.js
  • main.bundle.js

These are all bundles. Those additional bundles though don't suffer from this problem:

  • polyfills.bundle.js
  • scripts.bundle.js

The log given by the failure.

2017-08-28 15_01_07-karma

Desired functionality.

The three bundles above should be loaded only once, through script inclusion, and not at all through XHR.

Mention any other details that might be useful.

I investigated a bit more and identified commit 19f04af0777391cc72d096a0e315fe87bab161c6 as the one introducing the bug. The content changed in this commit is fairly simple, and you'll notice it concerns the source maps feature. I quickly tested removing those lines in packages/@angular/cli/plugins/karma.ts:

  • 73: resolves path to newly added dependencies karma-source-map-support
  • 76-77: uses the previously resolved path to actually add files into the Karma configuration

After removing those lines the bug disappears (even if I guess the source maps feature doesn't work a s expected after that.)

@filipesilva filipesilva self-assigned this Sep 4, 2017
@filipesilva filipesilva added needs: investigation Requires some digging to determine if action is needed P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent severity1: confusing type: bug/fix labels Sep 4, 2017
@vilanz
Copy link

vilanz commented Jul 25, 2018

Might cause #7296?

@clydin
Copy link
Member

clydin commented Sep 19, 2019

The CLI has been updated significantly since version 1.3.1. The current stable version is 8.3.5. If this problem is still being encountered with the current version, please consider opening a new issue with updated details.

@clydin clydin closed this as completed Sep 19, 2019
@jneuhaus20
Copy link

This is still present in 8.3.6. Can we just reopen this bug? It's already triaged, has activity on it, and (arguably most importantly) this is where google brought me when I searched the issue.

@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 Nov 18, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
needs: investigation Requires some digging to determine if action is needed P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent severity1: confusing type: bug/fix
Projects
None yet
Development

No branches or pull requests

5 participants