nuxt-security: Subresource Integrity error
Version
nuxt-security: 1.2.1 nuxt: 3.10.3
Reproduction Link
n/a
Steps to reproduce
n/a
What is Expected?
No SRI error after deploying to Azure Static Web Apps with azure
preset with default Nuxt Security’s SRI config.
What is actually happening?
About this issue
- Original URL
- State: closed
- Created 4 months ago
- Comments: 16 (8 by maintainers)
Looking at it right now, I can confirm the issue
@vejja @DamianGlowala I released patch 1.4.3 with a fix for that. Could you check if it works now? 😃
Hi @DamianGlowala
I managed to track the upstream error. Source issue is in
nitro@2.9.2
: https://github.com/unjs/nitro/issues/2217 Was resolved by https://github.com/unjs/nitro/pull/2239 which was merged innitro@2.9.3
Could you check this dependency to see if it works now ?
It won’t work by only upgrading version Issue in detail is that unstorage’s
getItem
method can now sometimes return a Buffer instead of an object at https://github.com/Baroshem/nuxt-security/blob/main/src/runtime/nitro/plugins/03-subresourceIntegrity.ts#L25@DamianGlowala we are facing the regression since Nuxt 3.9.0 Not sure where it comes from, but Buffers are involved in the bug
@Baroshem: the easiest way to fix the issue is to upgrade from Nuxt 3.8 to Nuxt 3.10, are you ok with that?