N
Nuxt3mo ago
Gus

How to handle 404 from the `_nuxt` folder?

Hey everyone, I've encountered an interesting issue and haven't found a good solution yet. According to the official Nuxt docs, when a chunk load event is triggered by a recent deployment, Nuxt handles it by performing a hard refresh, which usually resolves everything. However, in my case, for reasons I haven't been able to determine (I'd appreciate hearing any similar experiences), many assets are being requested as if trying to load an old version of the document. All these requests end up bootstrapping the entire Nuxt application and result in the website returning a 404 page. Here's the problem: When accessing the root of the website, it tries to load 20+ assets that might not exist anymore. Each of these requests bootstraps Nuxt, runs all the global and page middlewares, and sends a lot of events to Sentry. For example, here's a valid asset from the Nuxt website: https://nuxt.com/_nuxt/Q5ocEdzv.js You get the expected output. But if you try to access an asset that no longer exists: https://nuxt.com/_nuxt/Q5ocEdzv-INVALID-ASSET.js You see that the website loads, and in my case, it runs a few middlewares that rely on route parameters, resulting in many events being sent to Sentry. To summarize, I'm looking for help with the following: - Has anyone faced similar issues? - Are there any possible solutions or fixes I might not be aware of? - Is there a way to gracefully skip middlewares when these asset requests occur? - Why would these assets still be called frequently? - Any insights or suggestions would be greatly appreciated. Thanks!
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server