Link to the code that reproduces this issue
https://github.com/styled-components/styled-components-website
To Reproduce
- Enable
experimental: { sri: { algorithm: 'sha256' } } in next.config.mjs
- Deploy to Vercel (or any CDN with edge caching)
- Load the site in a browser
Current vs. Expected behavior
Current: Browser blocks scripts with errors like:
Failed to find a valid digest in the 'integrity' attribute for resource
'https://styled-components.com/_next/static/chunks/turbopack-0w~tdqgwj6w-f.js'
with computed SHA-256 integrity 'AtgbquOIdxzkrCKl+OJ4ftygSY0ED3Ynyy6vxt1C468='.
The resource has been blocked.
Expected: Integrity hashes should match the served content, or SRI should account for CDN transformations (compression, encoding) that alter the byte stream between build-time hashing and browser receipt.
Provide environment information
Next.js 16.2.0 (Turbopack)
Node.js 22.x
Deployed on Vercel
Which area(s) are affected?
SRI / Security
Additional context
Likely related to #74147 and #74149. The hash is generated at build time against the raw chunk, but the CDN may serve a differently-encoded version (e.g., Brotli/gzip content-encoding differences, or edge transformations). Disabling experimental.sri resolves the issue.
Link to the code that reproduces this issue
https://github.com/styled-components/styled-components-website
To Reproduce
experimental: { sri: { algorithm: 'sha256' } }innext.config.mjsCurrent vs. Expected behavior
Current: Browser blocks scripts with errors like:
Expected: Integrity hashes should match the served content, or SRI should account for CDN transformations (compression, encoding) that alter the byte stream between build-time hashing and browser receipt.
Provide environment information
Which area(s) are affected?
SRI / Security
Additional context
Likely related to #74147 and #74149. The hash is generated at build time against the raw chunk, but the CDN may serve a differently-encoded version (e.g., Brotli/gzip content-encoding differences, or edge transformations). Disabling
experimental.sriresolves the issue.