spatie / flare-vite-plugin-sourcemap-uploader

A Vite plugin for uploading sourcemaps to Flare
https://flareapp.io
MIT License
2 stars 2 forks source link

Vite production build produces non deterministic hash #9

Open kasparasg opened 1 month ago

kasparasg commented 1 month ago

Hey 👋 First of all, love Flare! ❤️

I may have discovered a bug with the sourmap uploader. If you run the production build, with sourcemap uploader plugin, the JS build produces a unique hash every single time even though the actual source code hasn't change. My hunch is perhaps that a new uuid is generated for every build, which gets injected into the final bundle. I think the sourcemap version may need to be generated differently to take content hash into account.

I've got a Laravel app with some React components. The app is deployed to multiple servers behind the load balancer and the assets are built at deploy time. So every server gets a unique JS bundle hash. This results in 404 errors when assets are served, because every request may be resolved by a different server.

I've disabled the source map uploader plugin for now.

kasparasg commented 3 weeks ago

@freekmurze not sure if this was seen yet. Sorry for the ping!