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

Subresource Integrity for lazy modules is broken when DL is enabled #15468

Closed
alan-agius4 opened this issue Aug 28, 2019 · 2 comments · Fixed by #15666
Closed

Subresource Integrity for lazy modules is broken when DL is enabled #15468

alan-agius4 opened this issue Aug 28, 2019 · 2 comments · Fixed by #15666

Comments

@alan-agius4
Copy link
Collaborator

🐞 Bug report

Command (mark with an x)

- [ ] new
- [X] build
- [ ] serve
- [ ] test
- [ ] e2e
- [ ] generate
- [ ] add
- [ ] update
- [ ] lint
- [ ] xi18n
- [ ] run
- [ ] config
- [ ] help
- [ ] version
- [ ] doc

Is this a regression?

Yes, this is caused by the downleveling process.

Description

🔬 Minimal Reproduction

ng new lazy-loading-dl --routing
cd lazy-loading-dl
ng g m foo --module app.module --route foo

Add the below in app.component.html

<a [routerLink]="['/foo']" >
  link to foo
</a>
ng build --prod --subresourceIntegrity
http-server dist/lazy-loading-dl

Open browser and click on the link

🔥 Exception or Error


127.0.0.1/:1 Failed to find a valid digest in the 'integrity' attribute for resource 'http://127.0.0.1:8080/5-es2015.0914cd2e5d35cddfa66f.js' with computed SHA-256 integrity '9yuul7bmARNSj/M5wygxgYjfklmwN0bTD+8YGHdn5/I='. The resource has been blocked.
main-es2015.8ce6a89e85cdffc26eb1.js:1 ERROR Error: Uncaught (in promise): ChunkLoadError: Loading chunk 5 failed.
(error: http://127.0.0.1:8080/5-es2015.0914cd2e5d35cddfa66f.js)
ChunkLoadError: Loading chunk 5 failed.
(error: http://127.0.0.1:8080/5-es2015.0914cd2e5d35cddfa66f.js)
    at Function.u.e (runtime-es2015.6b58afc9912521e9b6e5.js:1)
    at w (main-es2015.8ce6a89e85cdffc26eb1.js:1)
    at Rn.loadModuleFactory (main-es2015.8ce6a89e85cdffc26eb1.js:1)
    at Rn.load (main-es2015.8ce6a89e85cdffc26eb1.js:1)
    at c.project (main-es2015.8ce6a89e85cdffc26eb1.js:1)
    at c._tryNext (main-es2015.8ce6a89e85cdffc26eb1.js:1)
    at c._next (main-es2015.8ce6a89e85cdffc26eb1.js:1)
    at c.next (main-es2015.8ce6a89e85cdffc26eb1.js:1)
    at e._subscribe (main-es2015.8ce6a89e85cdffc26eb1.js:1)
    at e._trySubscribe (main-es2015.8ce6a89e85cdffc26eb1.js:1)
    at P (polyfills-es2015.fd917e7c3ed57f282ee5.js:1)
    at P (polyfills-es2015.fd917e7c3ed57f282ee5.js:1)
    at polyfills-es2015.fd917e7c3ed57f282ee5.js:1
    at a.invokeTask (polyfills-es2015.fd917e7c3ed57f282ee5.js:1)
    at Object.onInvokeTask (main-es2015.8ce6a89e85cdffc26eb1.js:1)
    at a.invokeTask (polyfills-es2015.fd917e7c3ed57f282ee5.js:1)
    at s.runTask (polyfills-es2015.fd917e7c3ed57f282ee5.js:1)
    at _ (polyfills-es2015.fd917e7c3ed57f282ee5.js:1)
    at c.invokeTask [as invoke] (polyfills-es2015.fd917e7c3ed57f282ee5.js:1)
    at y (polyfills-es2015.fd917e7c3ed57f282ee5.js:1)

🌍 Your Environment


Angular CLI: 8.3.0
Node: 10.10.0
OS: win32 x64
Angular: 8.2.3
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.803.0
@angular-devkit/build-angular     0.803.0
@angular-devkit/build-optimizer   0.803.0
@angular-devkit/build-webpack     0.803.0
@angular-devkit/core              8.3.0
@angular-devkit/schematics        8.3.0
@angular/cli                      8.3.0
@ngtools/webpack                  8.3.0
@schematics/angular               8.3.0
@schematics/update                0.803.0
rxjs                              6.4.0
typescript                        3.5.3
webpack                           4.39.2

Anything else relevant?

@aaronte
Copy link

aaronte commented Aug 28, 2019

+1

clydin added a commit to clydin/angular-cli that referenced this issue Sep 25, 2019
clydin added a commit to clydin/angular-cli that referenced this issue Sep 25, 2019
clydin added a commit to clydin/angular-cli that referenced this issue Sep 25, 2019
clydin added a commit to clydin/angular-cli that referenced this issue Sep 25, 2019
clydin added a commit to clydin/angular-cli that referenced this issue Sep 26, 2019
@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 Oct 27, 2019
@clydin clydin removed their assignment Jun 28, 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