N
Nuxt11mo ago
Richard E

Getting 404 after app.config.ts change

Not sure if anyone else if getting this but I've been making changes to app.config.ts in dev mode and Nitro is triggering a page reload but I'm then getting a 404 of that page. If I wait a little while I can refresh the page and everything is fine. Here is what I'm doing if you can reproduce. 1. Using the nuxt-ui-pro/saas project template here, https://github.com/nuxt-ui-pro/saas 2. Creating the initial site off the template with npx nuxi init -t github:nuxt-ui-pro/saas 3. Opening the code up with VS Code, then starting the dev server with pnpm run dev and everything looks fine 4. In the content subfolder, edit the 0.index.yml file and change the hero title and you should see everything hot reloads. I have developer tools open for my browser with Disable cache ticked because if I don't I get some cached content from another site I had on localhost:3000 5. Now if I edit the app.config.ts file and change anything or even just save what is already there Nitro sees a change and reloads that file, but in the brower I get the following:
{
"statusCode": 404,
"statusMessage": "Cannot find any path matching /.",
"stack": []
}
{
"statusCode": 404,
"statusMessage": "Cannot find any path matching /.",
"stack": []
}
6. If I refresh my browser page then I get the full page with changes Any ideas? This is killing any productivity I might have in editing the site and really annoying.
GitHub
GitHub - nuxt-ui-pro/saas: A SaaS template made with Nuxt UI Pro.
A SaaS template made with Nuxt UI Pro. Contribute to nuxt-ui-pro/saas development by creating an account on GitHub.
2 Replies
Richard E
Richard EOP11mo ago
So it looks like this call in the top of the page fails while it's rebuilding and the error is from the server. The check and throw after doesn't even get called as the messages are different.
const { data: page } = await useAsyncData('index', () => queryContent('/').findOne())
if (!page.value) {
throw createError({ statusCode: 404, statusMessage: 'Page not found', fatal: true })
}
const { data: page } = await useAsyncData('index', () => queryContent('/').findOne())
if (!page.value) {
throw createError({ statusCode: 404, statusMessage: 'Page not found', fatal: true })
}
Pascal Martineau
I'm getting the same error with the i18n module when I save a translation in locales/*.json it reloads the app but with the 404 "Cannot find any path matching..." in JSON format Plus the occasionnal WARN [Vue Router warn]: No match found for location with path "/_nuxt/node_modules/.pnpm/[email protected]/node_modules/tailwindcss/tailwind.css" in the console
Want results from more Discord servers?
Add your server