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.

Undefined route in Nuxt layout component in prod build

See original GitHub issue

Environment

- Operating System: `Linux`
- Node Version:     `v16.18.0`
- Nuxt Version:     `3.0.0-rc.13`
- Nitro Version:    `0.6.1`
- Package Manager:  `pnpm@7.15.0`
- Builder:          `vite`
- User Config:      `modules`, `oxyshopNuxt`, `i18n`, `experimental`
- Runtime Modules:  `normalizedModule()`, `normalizedModule()`
- Build Modules:    `-`

Reproduction

Build to prod

Describe the bug

In the dev environment everything works fine, once the application build to production. on the client side Nuxt RC-13 crashes on the error that the route is undefined. https://github.com/nuxt/framework/blob/59d8c51b5bd8d8f7de66f83494d9d39110e43c44/packages/nuxt/src/app/components/layout.ts#L73 On Nuxt RC-12 it works fine.

Additional context

image

Logs

TypeError: Cannot read properties of undefined (reading 'meta')
    at zc.fn (entry.6b774f36.js:78:63198)
    at zc.run (entry.6b774f36.js:1:4282)
    at get value [as value] (entry.6b774f36.js:1:12410)
    at Proxy.<anonymous> (entry.6b774f36.js:78:63258)
    at fl (entry.6b774f36.js:1:15833)
    at St (entry.6b774f36.js:1:49906)
    at zc.V [as fn] (entry.6b774f36.js:1:49994)
    at zc.run (entry.6b774f36.js:1:4282)
    at G.T.update (entry.6b774f36.js:1:50299)
    at G (entry.6b774f36.js:1:50325)
nE @ entry.6b774f36.js:1

Issue Analytics

  • State:closed
  • Created 10 months ago
  • Reactions:1
  • Comments:25 (19 by maintainers)

github_iconTop GitHub Comments

3reactions
dargmueslicommented, Nov 13, 2022

I am on v4.1.6 since it was released and yet I still face this error on Nuxt edge.

2reactions
danielroecommented, Nov 15, 2022

Please do provide a reproduction if that’s the case. This is an upstream issue (not directly caused by Nuxt) but if there’s anything I can do to help resolve this, I will.

Read more comments on GitHub >

github_iconTop Results From Across the Web

nuxt router-module render function or template not defined in ...
when i remove '@nuxtjs/router' from build modules in nuxt.config.js file, the error will ...
Read more >
The build Property - Nuxt
Nuxt lets you customize the webpack configuration for building your web application as you want.
Read more >
How To Navigate Between Views with Vue Router
You will also learn the different types of routes available to ... Next, create a Home.vue component inside of a directory called views...
Read more >
Understand Routing in Vue.js With Examples | by SaidHayani
Vue.js provide bunch of features to build a reusable web components,Routing ... to explain how Vue.js Routers work by building a Vue- template...
Read more >
Creating Server-side Rendered Vue.js Apps Using Nuxt.js
<template> <h1>About Page</h1> </template>. When you save, Nuxt will re-generate the routes for you. Seeing as we called our component about.vue , if...
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