Skip to content

5.0.0-alpha.4 generates wrong integrity hash with mini-css-extract-plugin #154

@zlk89

Description

@zlk89

Repro

  1. git clone and go to this branch sri-breaks-css: https://github.com/zlk89/webpack-reprods/tree/sri-breaks-css
  2. yarn
  3. yarn start and go to http://localhost:8080/, you can see an error on console:
 Failed to find a valid digest in the 'integrity' attribute for resource 'http://localhost:8080/297c2bb7ca06bdef00bd.css' with computed SHA-256 integrity 'x6erygV386tuxc7xPDZhRB5YQgrXe7VtRCH5hD4GW6E='. The resource has been blocked.
  1. Downgrade webpack-subresource-integrity to 5.0.0-alpha.3 and yarn to reinstall dependency
  2. yarn start again, and it works now

This appears to be related with the contenthash fix in 5.0.0-alpha.4, because this only happens when:

  • 5.0.0-alpha.4
  • use contenthash in mini-css-extract-plugin
  • use realcontenthash
  • enable sourcemap

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions