definePageMete is not defined
See original GitHub issueEnvironment
- 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
- Follow everything exactly listed at the Quick Start Session.
- Create
pages
andlayouts
folders. - Create a customized layout, and follow everything exactly listed at layouts and pages
- 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:
- Created a year ago
- Comments:5 (1 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
That’s a typo,
definePageMete
should’ve bedefinePageMeta
.Would you provide a reproduction? Note that you need a pages directory.