This repository was archived by the owner on Jun 13, 2024. It is now read-only.

Description
I tried to use the plugin in advanced projects. In the first one i could build but not load the js file, the console in the browser says:
Failed to find a valid digest in the 'integrity' attribute for resource 'http://127.0.0.1:8080/assets/index.5ef158b2.js' with computed SHA-384 integrity 'R2XRnrxjTxiLu4w3LeNCg3zSZFIf5fEeglzI0AA2xNBPtbT/YWKerFOhMXIzoJtb'. The resource has been blocked
This is the generated script tag where the error comes from:
<script type="module" crossorigin="" src="/assets/index.5ef158b2.js" integrity="sha384-Wl6kxwptiSC61eBxreLUI/hA1RPxBgf9W0fV77HpwvX2mrFJkZBzRUVEprF0TWHz"></script>
<link rel="modulepreload" href="/assets/vendor.821c7442.js">
Why is there no integrity attribute on the generated vendor js file?
In my secound project it wasn't able to run the "npm run build" command successfully. No matter how much assets i deleted from my index.html. The console wrote me everytime:
rendering chunks (2)...[vite:build-html] Cannot read properties of undefined (reading 'code') error during build:
TypeError: Cannot read properties of undefined (reading 'code')
at calculateIntegrityHashes (file:///.../node_modules/@small-tech/vite-plugin-sri/index.js:46:31)
For both projects i used the vue3 vite template. I don't know whats wrong there.