question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

404 error when created file in /pages and redirect new router(page), until restart the srerver

See original GitHub issue

Environment


  • Operating System: Windows_NT
  • Node Version: v16.14.2
  • Nuxt Version: 3.0.0-27496606.e43ba6e
  • Package Manager: npm@8.5.0
  • Builder: vite
  • User Config: -
  • Runtime Modules: -
  • Build Modules: -

Reproduction

https://v3.nuxtjs.org/guide/directory-structure/pages i follow the doc guaid about pages, run with local environment

update(17/04) :

  1. npx nuxi init nuxt3-app >> cd nuxt3-app >> npm install >> npm run dev

  2. create a home page in /pages index.vue <template><div>index page, go to <nuxt-link to='/test'>test</nuxt-link></div></template> when i created index.vue and change code in app.vue to this <template><NuxtPage/></template> the home page can auto render, it works

  3. but when i created test.vue in /pages <template><div>test</div></template> i click the test link in home page or i open the router link in broswer manually, the page render by 404 page

  4. i restart the server, then it works

Describe the bug

i created a new page file in /pages like /pages/test.vue then the /test response 404 error if i restart the server, then it works

Additional context

No response

Logs

No response

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:23 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
Aareksiocommented, Apr 18, 2022

I stumbled upon this issue multiple times during dev on Windows. A restart is required for routing to detect the new file. It may be specific to the OS.

0reactions
Administrator-Mcommented, Jun 10, 2022

I was on windows,It works when I access it with the tag “NuxtLink”,but when open the router link in broswer manually, the page render by 404 page

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Fix Error 404 Not Found on Your WordPress Site
The best way to fix this is to automatically redirect anyone who tries to access the old location to the new location.
Read more >
Error 404: 4 Ways to Fix It
Error 404 is a response code, meaning the server could not locate the requested content. Check this article to learn 4 steps to...
Read more >
React-router URLs don't work when refreshing or writing ...
Now build it using sudo npm run build . You need to create the "conf" file to solve the 404 not found page....
Read more >
What Does Error 404 Not Found Mean?
A 404 error is when a website's server can't find the page you're trying to access via a hyperlink or typing a URL...
Read more >
How to fix BrowserRouter for React Apps on Apache
When you're visiting a route of your app directly, e.g. via https://myapp.com/route/123 Apache tries to map that URL to a file in the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found