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
Invalid CSS asset filenames generated, breaks site operation #8274
Comments
Hi @IlyaSemenov, If you want to keep the name with build: {
extractCSS:true,
filenames: {
css: ({ isDev }) => (isDev ? '[name].css' : '[id].[contenthash].css')
}
} Hope this help you :) |
Of course this it not true. I updated the reproduction repository to demonstrate that (simply renamed the file to And of course it doesn't have anything to do with the file name being 40 symbols length either. I am experiencing the same problem in my real project with 'normal' file names. In the reproduction repo, I was simply creating randomly named files until I managed to reproduce the bug.
No, It won't. A dynamic page starts with an underscore, not ends with it. Besides, what's wrong with dynamic pages? It's not webpack business at all, it's something that is handled on a completely different level (vue-router). From webpack's point of view, "dynamic" pages are no different from non-dynamic.
Thank you, I understand how it works. Please consider this a bug report, not a support request. |
Thanks for your contribution to Nuxt!
Issues that are labeled as |
|
I have a similar issue with loading a chunk, it tries to retrieve |
Thanks for your contribution to Nuxt!
Issues that are labeled as |
|
Same here. I cant find a pattern on when this happens |
@danielroe @pi0 Its seems that the issue was resolved just for the css files case. I'm having the same problem here with app and chunk files names. |
I too am having the same issue in SSR with some JS assets having last double slash @pi0 could this be re-opened? I'm using:
|
@alexcroox please use a new bug report issue with reproduction or steps 🙏 (generally adding [name] to prod js assets is not best idea) |
Apologies, removing [name] has fixed this for me for JS assets |
Versions
Reproduction
https://github.com/IlyaSemenov/nuxt-css-invalid-filename-reproduction
Steps to reproduce
Using Node 10.15.3 and yarn 1.22.5:
(See README in the reproduction repo.)
What is Expected?
Build completes successfully. All generated filenames are valid.
What is actually happening?
Build completes successfully, however one of the filenames is invalid:
pages/123456789_123456789_123456789_123456789_/pages/test1/test/pages/test2/pages/test2/index/pages//6c0ffc7c.c67c3ba.css
. Note the double slash near the end (pages//6c0ffc7c.c67c3ba.css
).This invalid filename goes to the manifest. When these static assets are deployed onto certain CDNs (such as Amazon S3 compatible storages), they wouldn't load, for example:
schools//8be984b7.6b1ee97.css -> 403 Access Denied
schools/8be984b7.6b1ee97.css -> 200 OK
Moreover, this broken chunk completely breaks
<nuxt-link>
's pointing to the affected page! (Not included in the minimal reproduction, although it's not hard to add.)Additional context
This is a regression introduced with #7463 where the css/images/video URLs were changed to include
[name]
.Also, the documentation misleadingly lists the old defaults:
which is not true anymore.
The text was updated successfully, but these errors were encountered: