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.

Build fails with error: TypeError: Invalid value used as weak map key

See original GitHub issue

Hello The command pnpm build started to fail suddenly. The error is very new to me.

pnpm -v
6.9.1
node -v
v16.0.0

here is the whole output

 pnpm build

> waelio.com@0.2.2 build C:\Users\wahbe\Documents\GitHub\waelio.com
> cross-env NODE_ENV=production vite-ssg build


[vite-ssg] Build for client...
vite v2.3.8 building for production...
✓ 148 modules transformed.
dist/index.html                                   1.56kb
dist/manifest.webmanifest                         0.39kb
dist/ssr-manifest.json                            17.98kb
dist/assets/virtual_pwa-register.c298aae9.js      0.36kb / brotli: 0.23kb
dist/assets/app.2e115a7d.js                       14.60kb / brotli: 4.38kb
dist/assets/workbox-window.prod.es5.3ec2694c.js   5.07kb / brotli: 1.83kb 
dist/assets/[...all].1736958e.js                  0.22kb / brotli: 0.17kb 
dist/assets/timeline.fbb95060.js                  1.19kb / brotli: 0.56kb 
dist/assets/index.d6f56c2f.js                     3.72kb / brotli: 1.12kb 
dist/assets/terms.30188bec.js                     10.52kb / brotli: 2.80kb
dist/assets/privacy.a41dd229.js                   13.82kb / brotli: 2.19kb
dist/assets/about.29969d21.js                     0.66kb / brotli: 0.28kb 
dist/assets/404.5aa7cd15.js                       0.52kb / brotli: 0.30kb 
dist/assets/home.60b6dea3.js                      0.50kb / brotli: 0.30kb 
dist/assets/contact.c764fb33.js                   4.81kb / brotli: 1.67kb 
dist/assets/index.b25c940d.css                    0.22kb / brotli: 0.10kb 
dist/assets/contact.81aceb69.css                  1.02kb / brotli: 0.30kb 
dist/assets/app.85bb450a.css                      18.71kb / brotli: 3.89kb
dist/assets/index.20a20aff.js                     93.83kb / brotli: 29.41kb
dist/assets/vendor.b40dd116.js                    189.95kb / brotli: 59.69kb

[vite-ssg] Build for server...
vite v2.3.8 building SSR bundle for production...
✓ 54 modules transformed.
.vite-ssg-temp/manifest.webmanifest        0.39kb
.vite-ssg-temp/main.js                     134.67kb
.vite-ssg-temp/assets/style.de8298f4.css   24.08kb

[vite-ssg] Rendering Pages... (6)
TypeError: Invalid value used as weak map key
    at WeakMap.set (<anonymous>)
    at normalizePropsOptions (C:\Users\wahbe\Documents\GitHub\waelio.com\node_modules\.pnpm\@vue+runtime-core@3.1.2\node_modules\@vue\runtime-core\dist\runtime-core.cjs.prod.js:2770:15)
    at createComponentInstance (C:\Users\wahbe\Documents\GitHub\waelio.com\node_modules\.pnpm\@vue+runtime-core@3.1.2\node_modules\@vue\runtime-core\dist\runtime-core.cjs.prod.js:5532:23)
    at renderComponentVNode (C:\Users\wahbe\Documents\GitHub\waelio.com\node_modules\.pnpm\@vue+server-renderer@3.1.2_vue@3.1.2\node_modules\@vue\server-renderer\dist\server-renderer.cjs.prod.js:156:22)
    at Object.ssrRenderComponent (C:\Users\wahbe\Documents\GitHub\waelio.com\node_modules\.pnpm\@vue+server-renderer@3.1.2_vue@3.1.2\node_modules\@vue\server-renderer\dist\server-renderer.cjs.prod.js:484:12)
    at C:\Users\wahbe\Documents\GitHub\waelio.com\.vite-ssg-temp\main.js:645:30
    at renderComponentSubTree (C:\Users\wahbe\Documents\GitHub\waelio.com\node_modules\.pnpm\@vue+server-renderer@3.1.2_vue@3.1.2\node_modules\@vue\server-renderer\dist\server-renderer.cjs.prod.js:222:13)
    at renderComponentVNode (C:\Users\wahbe\Documents\GitHub\waelio.com\node_modules\.pnpm\@vue+server-renderer@3.1.2_vue@3.1.2\node_modules\@vue\server-renderer\dist\server-renderer.cjs.prod.js:173:16)
    at Object.ssrRenderComponent (C:\Users\wahbe\Documents\GitHub\waelio.com\node_modules\.pnpm\@vue+server-renderer@3.1.2_vue@3.1.2\node_modules\@vue\server-renderer\dist\server-renderer.cjs.prod.js:484:12)
    at _sfc_ssrRender$3 (C:\Users\wahbe\Documents\GitHub\waelio.com\.vite-ssg-temp\main.js:796:24)
 ERROR  Command failed with exit code 1.

Any ideas? Thank you

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
hannoerucommented, Sep 28, 2021

Make sure you don’t have any unclosed HTML tags or invalid HTML tags in the Markdown file.

2reactions
josh-hemphillcommented, Jan 19, 2022

I’m getting this and have tried stripping out plugins to narrow it down, but I’m not getting anywhere with it. Is there a way to run vite-ssg with an active debugger on so I can step through the code and extract what is causing it? UPDATE: I went ahead and just added console log statements to the dependency files. Found out it was unresolved components, but were unresolved because I was removing plugins to find what the original error was; so I may update again. UPDATE2: The culprit was the order of my plugins… I really wish Vue would give better error output.

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 >
Is there any way to debug a TypeError: Invalid value used as ...
You could try to find out from the Polymer source code where WeakMap is used or perhaps check the source of WeakMap and...
Read more >
"Invalid value used as weak map key" after update to r131
Hey guys, I just updated to r131.3. Im using typescript, so thats the latest type supported version right now.
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 >
Invalid value used as weak map key at WeakMap.set
Uncaught TypeError: Invalid value used as weak map key at WeakMap.set ... I keep running into Ajax search errors with Ivory search.. you...
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