-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Public assets 404 Not Found with Nitro publicAssets maxAge is set. #26517
Comments
Start a new pull request in StackBlitz Codeflow. |
Would you see if you can reproduce this in pure Nitro (reproduction sandbox), and if so, raise there? 🙏 |
Can be checked with Elk in dev server, check this commit elk-zone/elk@932af07 . Screenshot using the playground in my Nuxt local clone: |
The problem seems to be also in nuxt, it is ignoring the aliases in layers:
It seems server routes with same problem. |
|
As a temporary solution I would suggest to use this config only for production builds, as stated in this stackoverflow answer, using nuxt config environment separation, and configuring nitro under |
Hi @h4ckthepl4net, your temporary solution makes no difference for me. Both in development and production the assets return a 404 html page instead of the asset. Would you happen to know any other fixes for this issue? |
@Jessuhh here is my nitro config
which is imported in nuxt.config.ts
and it just works fine |
Thank you! I made the rookie mistake of messing up my imports by pointing to |
Environment
Reproduction
https://stackblitz.com/edit/github-kjtmai?file=nuxt.config.ts
Describe the bug
When attempting to set Cache-Control headers for assets using the
maxAge
option using thenitro.publicAssets
option, causes the assets to return a 404 error.Additional context
No response
Logs
No response
The text was updated successfully, but these errors were encountered: