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.

Nuxt not creating routes and not detecting changes in pages directory?

See original GitHub issue

Environment

  • Operating System: Windows_NT
  • Node Version: v16.13.1
  • Nuxt Version: 3.0.0-27338323.1e98259
  • Package Manager: npm@8.1.2
  • Bundler: Vite
  • User Config: -
  • Runtime Modules: -
  • Build Modules: -

Reproduction

  1. Followed README.md installation guide with npm.
  2. Created pages folder
  3. Created index.vue in /pages
  4. Changed index.vue to home.vue

Describe the bug

nuxt is not creating routes i think?

Additional context

const vite_ssr_import_6 = await vite_ssr_import(“/@id/__x00__virtual:C:/Users/BUGA/Documents/VSCODE/Web Projects/nuxt3-app/.nuxt/routes.mjs”);

const router = __vite_ssr_import_1__.createRouter({ history: routerHistory, routes: __vite_ssr_import_6__.default });

__vite_ssr_import_6__.default returns undefined

Logs

Cannot read properties of undefined (reading 'forEach')
  at createRouterMatcher (C:\Users\BUGA\Documents\VSCODE\Web Projects\nuxt3-app\node_modules\vue-router\dist\vue-router.cjs.js:1469:12)
  at Module.createRouter (C:\Users\BUGA\Documents\VSCODE\Web Projects\nuxt3-app\node_modules\vue-router\dist\vue-router.cjs.js:2796:21)
  at file:///C:/Users/BUGA/Documents/VSCODE/Web%20Projects/nuxt3-app/.nuxt/dist/server/server.mjs:1743:40
  at file:///C:/Users/BUGA/Documents/VSCODE/Web%20Projects/nuxt3-app/.nuxt/dist/server/server.mjs:210:57
  at callWithNuxt (file:///C:/Users/BUGA/Documents/VSCODE/Web%20Projects/nuxt3-app/.nuxt/dist/server/server.mjs:259:13)
  at applyPlugin (file:///C:/Users/BUGA/Documents/VSCODE/Web%20Projects/nuxt3-app/.nuxt/dist/server/server.mjs:210:29)
  at Module.applyPlugins (file:///C:/Users/BUGA/Documents/VSCODE/Web%20Projects/nuxt3-app/.nuxt/dist/server/server.mjs:220:11)
  at async createNuxtAppServer (file:///C:/Users/BUGA/Documents/VSCODE/Web%20Projects/nuxt3-app/.nuxt/dist/server/server.mjs:51:5)
  at async renderToString (file:///C:/Users/BUGA/Documents/VSCODE/Web%20Projects/nuxt3-app/node_modules/vue-bundle-renderer/dist/index.mjs:248:19)
  at async renderMiddleware (file:///C:/Users/BUGA/Documents/VSCODE/Web%20Projects/nuxt3-app/.nuxt/nitro/index.mjs:191:20)Cannot read properties of undefined (reading 'forEach')
  at createRouterMatcher (C:\Users\BUGA\Documents\VSCODE\Web Projects\nuxt3-app\node_modules\vue-router\dist\vue-router.cjs.js:1469:12)
  at Module.createRouter (C:\Users\BUGA\Documents\VSCODE\Web Projects\nuxt3-app\node_modules\vue-router\dist\vue-router.cjs.js:2796:21)
  at file:///C:/Users/BUGA/Documents/VSCODE/Web%20Projects/nuxt3-app/.nuxt/dist/server/server.mjs:1743:40
  at file:///C:/Users/BUGA/Documents/VSCODE/Web%20Projects/nuxt3-app/.nuxt/dist/server/server.mjs:210:57
  at callWithNuxt (file:///C:/Users/BUGA/Documents/VSCODE/Web%20Projects/nuxt3-app/.nuxt/dist/server/server.mjs:259:13)
  at applyPlugin (file:///C:/Users/BUGA/Documents/VSCODE/Web%20Projects/nuxt3-app/.nuxt/dist/server/server.mjs:210:29)
  at Module.applyPlugins (file:///C:/Users/BUGA/Documents/VSCODE/Web%20Projects/nuxt3-app/.nuxt/dist/server/server.mjs:220:11)
  at async createNuxtAppServer (file:///C:/Users/BUGA/Documents/VSCODE/Web%20Projects/nuxt3-app/.nuxt/dist/server/server.mjs:51:5)
  at async renderToString (file:///C:/Users/BUGA/Documents/VSCODE/Web%20Projects/nuxt3-app/node_modules/vue-bundle-renderer/dist/index.mjs:248:19)
  at async renderMiddleware (file:///C:/Users/BUGA/Documents/VSCODE/Web%20Projects/nuxt3-app/.nuxt/nitro/index.mjs:191:20)

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:13 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
rashidmyacommented, Jan 5, 2022

@danielroe oh… idk how i missed that sorry. now the issue i get is the same as #1367

0reactions
danielroecommented, Jan 5, 2022

@rashidmya You need to add <NuxtPage /> in your app.vue. Docs.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Nuxt doesn't update on route change - vue.js - Stack Overflow
Fetch is triggered, but the content on the page is not updated. Url in browser is changed. Here's a few things I've tried...
Read more >
The router Property - Nuxt
The router property. The router property lets you customize Nuxt router. (vue-router ). base. Type: String; Default: '/'. The base URL of the...
Read more >
File System Routing - Nuxt
File system routing. Nuxt automatically generates the vue-router configuration based on your file tree of Vue files inside the pages directory.
Read more >
The generate Property - Nuxt
Directory name created when building web applications using the nuxt generate ... by excludes (the files that you do not want generated as...
Read more >
Server Side Rendering - Nuxt
Because you are in a Node.js environment you have access to Node.js objects such as req and res . You do not have...
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