Skip to content
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

Failed to load resource: the server responded with a status of 404 (Not Found) #21974

Closed
fxzer opened this issue Jul 6, 2023 · 4 comments
Closed

Comments

@fxzer
Copy link

fxzer commented Jul 6, 2023

Environment

"nuxt": "^3.6.0",
"@unocss/nuxt": "^0.51.13",

Reproduction

前两天的项目一点问题没有,今天项目部署完发现 unocss 的样式没应用上,试着降了nuxt,unocss 版本降回上个礼拜一样,还是没有解决,控制台报payload 相关的错,请问该如何解决呀?找到了关键性代码,但是还不知道怎么解决,请问有相同问题的小伙伴吗,是怎么解决的呢?

There was no problem with the project two days before. Today, after the project deployment, I found that the style of the Unocss was not applied. Try to reduce the NUXT. The UNOCSS version was reduced to the last week. Solve, I found the key code, but I don’t know how to solve it!Is there a friend with the same problem, how can it be solved?
image

image
image

Describe the bug

生产环境样式丢失,以及控制台每页都报错:Failed to load resource: the server responded with a status of 404 (Not Found)
The production environment style is missing and every page of the console reports an error:Failed to load resource: the server responded with a status of 404 (Not Found)
image
image

开发环境正常,控制台没报错
The development environment is normal and the console did not report an error.
image
image

Additional context

No response

Logs

No response

Copy link
Member

The issue here is that not all your pages were prerendered so the payloads for those pages are returning 404s. You can disable payload extraction entirely with:

export default defineNuxtConfig({
  experimental: {
    payloadExtraction: false
  }
})

When #21641 is merged, we will know which pages have associated payloads and only fetch them.

@fxzer
Copy link
Author

fxzer commented Jul 6, 2023

Effective, very grateful

@danielroe
Copy link
Member

You are very welcome 😊

@danielroe
Copy link
Member

this was resolved in #21641.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants