Closed eitjuh closed 2 years ago
Visit the preview URL for this PR (updated for commit d15bffc):
https://emeris-app--pr1760-build-assetfiles-wit-8sj8dt1y.web.app
(expires Tue, 14 Jun 2022 12:10:56 GMT)
🔥 via Firebase Hosting GitHub Action 🌎
The hashes are important for the user to have the latest changes: https://stackoverflow.com/questions/59194365/webpack-4-hash-and-contenthash-and-chunkhash-when-to-use-which, otherwise the user will always see an old version if we have cache in place, and I think is a huge problem for us
The hashes are important for the user to have the latest changes: stackoverflow.com/questions/59194365/webpack-4-hash-and-contenthash-and-chunkhash-when-to-use-which, otherwise the user will always see an old version if we have cache in place, and I think is a huge problem for us
would this create a temporary solution?
instead of
https://app.emeris.com/assets/Asset.4782f5bd.js
we use
https://app.emeris.com/assets/Asset.js?v=4782f5bd
@Dawntraoz would this solve your concern? This way we could still have the import resolve well, and also update it with the new hash
would this create a temporary solution? instead of
https://app.emeris.com/assets/Asset.4782f5bd.js
we usehttps://app.emeris.com/assets/Asset.js?v=4782f5bd
@Dawntraoz would this solve your concern? This way we could still have the import resolve well, and also update it with the new hash
Of course, but guessing that the version should be one for build and not one for file (as it was wtih the chunkHash).
Caution:
I assume this hash is implemented to ensure a new file is loaded. It's important to check if caching is handled correctly with this fix. It might lead to new problems with caching, and needing hard refreshes and things like that.
Problem:
The current build is causing this error: It is because we are loading https://app.emeris.com/assets/Asset.4782f5bd.js which has this hash![image](https://user-images.githubusercontent.com/1449065/167380479-cf010b31-f269-4926-ac76-6b25fcaeeaa6.png)
4782f5bd
inside the urlSolution:
As described in https://github.com/vitejs/vite/issues/378 There is an easy way to remove this hash by adding:
which cleans up the hash from the files, and you can see my dist folder, with a clean
Asset.js
:This means it won't fail to dynamically import these modules anymore.