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.

definePageMete is not defined

See original GitHub issue

Environment

  • Operating System: Darwin
  • Node Version: v16.13.1
  • Nuxt Version: 3.0.0-rc.4
  • Package Manager: pnpm@6.32.3
  • Builder: vite
  • User Config: -
  • Runtime Modules: -
  • Build Modules: -

Reproduction

  1. Follow everything exactly listed at the Quick Start Session.
  2. Create pages and layouts folders.
  3. Create a customized layout, and follow everything exactly listed at layouts and pages
  4. Try to start the server, got definePageMete is not defined

Here is a reproduction repo: https://github.com/zhouzilong2020/nuxt3-definePageMete

Describe the bug

definePageMete is not defined.

I noticed that there are some discussions at Jan, but I still came into the same issue.

Additional context

SOS

Logs

at <Index onVnodeUnmounted=fn<onVnodeUnmounted> ref=Ref< undefined > key="/" >
[nuxt] [request error] definePageMete is not defined
  at setup (./.nuxt/dist/server/server.mjs:2838:5)  
  at _sfc_main.setup (./.nuxt/dist/server/server.mjs:2857:23)  
  at callWithErrorHandling (./node_modules/.pnpm/@vue+runtime-core@3.2.37/node_modules/@vue/runtime-core/dist/runtime-core.cjs.js:157:22)  
  at setupStatefulComponent (./node_modules/.pnpm/@vue+runtime-core@3.2.37/node_modules/@vue/runtime-core/dist/runtime-core.cjs.js:7084:29)  
  at setupComponent (./node_modules/.pnpm/@vue+runtime-core@3.2.37/node_modules/@vue/runtime-core/dist/runtime-core.cjs.js:7039:11)  
  at renderComponentVNode (./node_modules/.pnpm/@vue+server-renderer@3.2.37_vue@3.2.37/node_modules/@vue/server-renderer/dist/server-renderer.cjs.js:172:17)  
  at renderVNode (./node_modules/.pnpm/@vue+server-renderer@3.2.37_vue@3.2.37/node_modules/@vue/server-renderer/dist/server-renderer.cjs.js:295:22)  
  at renderVNode (./node_modules/.pnpm/@vue+server-renderer@3.2.37_vue@3.2.37/node_modules/@vue/server-renderer/dist/server-renderer.cjs.js:301:17)  
  at renderComponentSubTree (./node_modules/.pnpm/@vue+server-renderer@3.2.37_vue@3.2.37/node_modules/@vue/server-renderer/dist/server-renderer.cjs.js:259:13)  
  at renderComponentVNode (./node_modules/.pnpm/@vue+server-renderer@3.2.37_vue@3.2.37/node_modules/@vue/server-renderer/dist/server-renderer.cjs.js:188:16)
[nitro] [dev] [unhandledRejection] ReferenceError: definePageMete is not defined
    at setup (file:///Users/zhouzilong/nuxt3/nuxt-app/.nuxt/dist/server/server.mjs:2838:5)
    at _sfc_main.setup (file:///Users/zhouzilong/nuxt3/nuxt-app/.nuxt/dist/server/server.mjs:2857:23)
    at callWithErrorHandling (/Users/zhouzilong/nuxt3/nuxt-app/node_modules/.pnpm/@vue+runtime-core@3.2.37/node_modules/@vue/runtime-core/dist/runtime-core.cjs.js:157:22)
    at setupStatefulComponent (/Users/zhouzilong/nuxt3/nuxt-app/node_modules/.pnpm/@vue+runtime-core@3.2.37/node_modules/@vue/runtime-core/dist/runtime-core.cjs.js:7084:29)
    at setupComponent (/Users/zhouzilong/nuxt3/nuxt-app/node_modules/.pnpm/@vue+runtime-core@3.2.37/node_modules/@vue/runtime-core/dist/runtime-core.cjs.js:7039:11)
    at renderComponentVNode (/Users/zhouzilong/nuxt3/nuxt-app/node_modules/.pnpm/@vue+server-renderer@3.2.37_vue@3.2.37/node_modules/@vue/server-renderer/dist/server-renderer.cjs.js:172:17)
    at renderVNode (/Users/zhouzilong/nuxt3/nuxt-app/node_modules/.pnpm/@vue+server-renderer@3.2.37_vue@3.2.37/node_modules/@vue/server-renderer/dist/server-renderer.cjs.js:295:22)
    at renderVNode (/Users/zhouzilong/nuxt3/nuxt-app/node_modules/.pnpm/@vue+server-renderer@3.2.37_vue@3.2.37/node_modules/@vue/server-renderer/dist/server-renderer.cjs.js:301:17)
    at renderComponentSubTree (/Users/zhouzilong/nuxt3/nuxt-app/node_modules/.pnpm/@vue+server-renderer@3.2.37_vue@3.2.37/node_modules/@vue/server-renderer/dist/server-renderer.cjs.js:259:13)
    at renderComponentVNode (/Users/zhouzilong/nuxt3/nuxt-app/node_modules/.pnpm/@vue+server-renderer@3.2.37_vue@3.2.37/node_modules/@vue/server-renderer/dist/server-renderer.cjs.js:188:16)```

Issue Analytics

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

github_iconTop GitHub Comments

2reactions
aynhcommented, Jun 16, 2022

That’s a typo, definePageMete should’ve be definePageMeta.

1reaction
danielroecommented, Jun 28, 2022

Would you provide a reproduction? Note that you need a pages directory.

Read more comments on GitHub >

github_iconTop Results From Across the Web

definePageMeta is not defined error · Discussion #2770 - GitHub
An error will show (definePageMeta is not defined...) when using script setup on a page. <script setup> definePageMeta({ layout: "custom", }); ...
Read more >
definePageMeta · Nuxt Utils
definePageMeta is a compiler macro that you can use to set metadata for your page components located in the pages/ directory (unless set...
Read more >
vuepress build docs get ReferenceError: pageMeta is not ...
tl;dr You need to downgrade vue-router which is installed as part of vuepress to match ~3.1.3. I've basically encountered the same error ...
Read more >
nuxt3 definePageMeta no update - CodeSandbox
drm-addoptio drm-addoptio. Templatenuxt/starter; Environmentnuxt. Files. layouts. pages. index.vue .gitignore. README.md. nuxt.config.ts. package.json.
Read more >
Document-driven - Nuxt Content
This means that exposed refs from useContent() will be undefined . <script setup lang="ts">definePageMeta({ documentDriven: false})</script>
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