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

Nuxt 3.8.1 breaks Subresource Integrity #305

Closed
vejja opened this issue Nov 27, 2023 · 1 comment · Fixed by #304 or #311
Closed

Nuxt 3.8.1 breaks Subresource Integrity #305

vejja opened this issue Nov 27, 2023 · 1 comment · Fixed by #304 or #311
Labels
bug Something isn't working

Comments

@vejja
Copy link
Collaborator

vejja commented Nov 27, 2023

No SRI attributes in SSG mode

Version

nuxt-security: 1.0.0-rc.4
nuxt: ^3.8.1

Reproduction Link

https://stackblitz.com/edit/nuxt-starter-3x8r6t?file=README.md

Steps to reproduce

Open Stackblitz repro with DevTools, inspect Response

What is Expected?

<head> elements should contain integrity attributes

What is actually happening?

<head> elements do not contain integrity attributes

Issue description

The issue only appears in SSG mode. SSR mode is not affected.
The Stackblitz repro installs in SSG mode to illustrate the issue.
Capture d’écran 2023-11-28 à 11 06 18

You can modify the nuxt version to 3.8.0 and the issue will disappear
Capture d’écran 2023-11-28 à 11 06 05

Origin of issue

Nuxt 3.8.1 modified the behavior of the nitro:build:public-assets hook.

  • Before 3.8.1, this hook was called before pre-rendering pages
  • After 3.8.1, this hook is now called after pre-rendering pages

Responsible commit was nuxt/nuxt@a4b333b#diff-85b4fe47ac4284e88552626029d5147793563b4dcdab205cd8dc6afb190222aaR462

Resolution

PR #304 will fix

@vejja vejja added the bug Something isn't working label Nov 27, 2023
@vejja vejja changed the title Nuxt 3.8.2 breaks Subresource Integrity Nuxt 3.8.1 breaks Subresource Integrity Nov 28, 2023
@Baroshem
Copy link
Owner

Baroshem commented Dec 2, 2023

@vejja once again, thank you si much for both finding and fixing an issue! 💚

@Baroshem Baroshem mentioned this issue Dec 5, 2023
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants