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.

Invalid value used as weak map key

See original GitHub issue

Environment


  • Operating System: Linux
  • Node Version: v16.14.2
  • Nuxt Version: 3.0.0-27491748.3186841
  • Package Manager: yarn@1.22.10
  • Builder: vite
  • User Config: -
  • Runtime Modules: -
  • Build Modules: -

Reproduction

https://stackblitz.com/edit/github-twtnms

Describe the bug

yarn dev and see problem

Additional context

No response

Logs

[Vue warn]: Failed to resolve component: NuxtPage
If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement.
[nitro] [request error] Invalid value used as weak map key
  at WeakMap.set (<anonymous>)  
  at normalizePropsOptions (./node_modules/@vue/runtime-core/dist/runtime-core.cjs.js:3384:11)  
  at createComponentInstance (./node_modules/@vue/runtime-core/dist/runtime-core.cjs.js:6851:23)  
  at renderComponentVNode (./node_modules/@vue/server-renderer/dist/server-renderer.cjs.js:197:22)  
  at Module.ssrRenderComponent (./node_modules/@vue/server-renderer/dist/server-renderer.cjs.js:629:12)  
  at eval (./.nuxt/dist/server/server.mjs:2977:37)  
  at renderFnWithContext (./node_modules/@vue/runtime-core/dist/runtime-core.cjs.js:844:21)  
  at Module.ssrRenderSlot (./node_modules/@vue/server-renderer/dist/server-renderer.cjs.js:641:21)  
  at _sfc_ssrRender (./.nuxt/dist/server/server.mjs:3102:25)  
  at renderComponentSubTree (./node_modules/@vue/server-renderer/dist/server-renderer.cjs.js:269:13)
[Vue warn]: Failed to resolve component: NuxtPage
If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement.
[nitro] [dev] [unhandledRejection] TypeError: Invalid value used as weak map key
[Vue warn]: Failed to resolve component: NuxtPage
If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement.
[nitro] [dev] [unhandledRejection] TypeError: Invalid value used as weak map key
[Vue warn]: Failed to resolve component: NuxtPage
If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement.
[nitro] [dev] [unhandledRejection] TypeError: Invalid value used as weak map key
[Vue warn]: Failed to resolve component: NuxtPage
If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement.
[nitro] [dev] [unhandledRejection] TypeError: Invalid value used as weak map key

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:3
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

5reactions
danielroecommented, Apr 11, 2022

As @Aareksio says, <NuxtPage> is not available if you do not have a pages/ folder in your source directory.

3reactions
Aareksiocommented, Apr 10, 2022

page/ -> pages/

If you stumbled upon this issue in search, the exact error can also appear when you forget to include {} inside defineNuxtConfig. There are other ways to get it too, check your configuration and make sure all is according to docs.

Read more comments on GitHub >

github_iconTop Results From Across the Web

TypeError: Invalid value used as weak map key #15 - GitHub
No idea why, but I was getting this error. Do you know if I'm using some sort of wrong value as a key...
Read more >
nuxt request error Invalid value used as weak map key
This error occurs when the component you are referencing is not registered, see https://github.com/nuxt/framework/discussions/4588 and ...
Read more >
Let's find out about WeakMap | TOAST UI
A WeakMap object is a collection of key/value pairs in which keys are weakly referenced. The keys must be objects. A primitive value...
Read more >
WeakMap - JavaScript - MDN Web Docs
A WeakMap is a collection of key/value pairs whose keys must be objects, with values of any arbitrary JavaScript type, and which does...
Read more >
"Invalid value used as weak map key" after update to r131
Since then Im getting an error. threejs r 0.131.3 types/three 0.131.1. Angular 10.1.6. Invalid value used as weak map key at WeakMap.set ()...
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