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.

[SOLVED] defineRouteMeta is not defined

See original GitHub issue

Environment


  • Operating System: Windows_NT
  • Node Version: v18.1.0
  • Nuxt Version: 3.0.0-rc.6
  • Package Manager: npm@8.8.0
  • Builder: vite
  • User Config: srcDir, alias
  • Runtime Modules: -
  • Build Modules: -

Reproduction

No reproduction link. Just a nuxt 3 RC 6 project from scratch and a auth.global.js in server/middleware.

Describe the bug

login.vue:

<script setup>
defineRouteMeta({
  auth: true
})
</script>

index.vue:

<template>
  <div>
     <h1>Nuxt App</h1>
     <button @click="$router.push('/login')">Login</button>
  </div>
</template>

app.vue:

<template>
    <NuxtPage/>
</template>

image

Additional context

No response

Logs

No response

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
angelhdzmultimediacommented, Jul 30, 2022

Silly me! Works like magic now! Appreciate your time and energy a lot. Will keep studying Nuxt 3, it’s promising!

1reaction
danielroecommented, Jul 30, 2022

Move ~/server/middleware/auth.global.ts to ~/middleware/auth.global.ts. And no need to configure the @ alias.

Read more comments on GitHub >

github_iconTop Results From Across the Web

defineRouteMeta({}) compiler macro #2468 - nuxt/framework
In some cases we care about the route, not the page component specifically. ... We need to be able to define the layout...
Read more >
Python nameerror name is not defined Solution - Career Karma
A NameError is raised when you try to use a variable or a function name that is not valid. In Python, code runs...
Read more >
How to fix Name Not Defined Error in Python - YouTube
This video will explain how to solve the 'something' is not defined error in Python.
Read more >
How to solve route not defined - php - Stack Overflow
Whenever I run my program, I get an error "Route [userproductss.prdtview] not defined. (View ...
Read more >
The fullstack Angular meta-framework
Error: Unable to render WelcomeCard because it is undefined! Did you forget to import the ... If the solution is ok I can...
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