Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when using with unplugin-vue-components and SSR #112

Closed
5 tasks done
AaronBeaudoin opened this issue Aug 17, 2022 · 5 comments
Closed
5 tasks done

Error when using with unplugin-vue-components and SSR #112

AaronBeaudoin opened this issue Aug 17, 2022 · 5 comments

Comments

@AaronBeaudoin
Copy link

Describe the bug

Minimal reproduction here (with steps in README):
https://github.com/AaronBeaudoin/vite-plugin-md-issue-weakmap-key

Description

I have a minimal Markdown.md file:

<Example/>

Where <Example/> is being auto-imported by unplugin-vue-components from ./components/Example.vue:

<template>
  Example
</template>

During development, going to the page shows the text "Example" as expected.

However, after building for SSR, going to the page results in the following error:

[Vue warn]: Failed to resolve component: example
If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement.
/Users/aryse/Projects/open-source/vite-plugin-md-issue-weakmap-key/node_modules/@vue/runtime-core/dist/runtime-core.cjs.js:3927
        cache.set(comp, shared.EMPTY_ARR);
              ^

TypeError: Invalid value used as weak map key
    at WeakMap.set (<anonymous>)
    at normalizePropsOptions (/Users/aryse/Projects/open-source/vite-plugin-md-issue-weakmap-key/node_modules/@vue/runtime-core/dist/runtime-core.cjs.js:3927:15)
    at createComponentInstance (/Users/aryse/Projects/open-source/vite-plugin-md-issue-weakmap-key/node_modules/@vue/runtime-core/dist/runtime-core.cjs.js:6957:23)
    at renderComponentVNode (/Users/aryse/Projects/open-source/vite-plugin-md-issue-weakmap-key/node_modules/@vue/server-renderer/dist/server-renderer.cjs.js:171:22)
    at ssrRenderComponent (/Users/aryse/Projects/open-source/vite-plugin-md-issue-weakmap-key/node_modules/@vue/server-renderer/dist/server-renderer.cjs.js:608:12)
    at file:///Users/aryse/Projects/open-source/vite-plugin-md-issue-weakmap-key/dist/server/server.mjs:11:13
    at renderComponentSubTree (/Users/aryse/Projects/open-source/vite-plugin-md-issue-weakmap-key/node_modules/@vue/server-renderer/dist/server-renderer.cjs.js:253:13)
    at renderComponentVNode (/Users/aryse/Projects/open-source/vite-plugin-md-issue-weakmap-key/node_modules/@vue/server-renderer/dist/server-renderer.cjs.js:188:16)
    at renderVNode (/Users/aryse/Projects/open-source/vite-plugin-md-issue-weakmap-key/node_modules/@vue/server-renderer/dist/server-renderer.cjs.js:295:22)
    at renderComponentSubTree (/Users/aryse/Projects/open-source/vite-plugin-md-issue-weakmap-key/node_modules/@vue/server-renderer/dist/server-renderer.cjs.js:259:13)

Reproduction

https://github.com/AaronBeaudoin/vite-plugin-md-issue-weakmap-key

System Info

System:
    OS: macOS 12.5
    CPU: (10) arm64 Apple M1 Pro
    Memory: 168.19 MB / 16.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 16.14.0 - ~/.nvm/versions/node/v16.14.0/bin/node
    npm: 8.3.1 - ~/.nvm/versions/node/v16.14.0/bin/npm
  Browsers:
    Chrome: 104.0.5112.79
    Safari: 15.6

Used Package Manager

npm

Validations

  • Follow our Code of Conduct
  • Read the Contributing Guide.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead.
  • The provided reproduction is a minimal reproducible of the bug.
@brillout
Copy link

The reproduction Aaron provided uses Vite's SSR API.

This means that this bug affects all Vite frameworks (vite-plugin-ssr - #422, Nuxt, ...).

@AaronBeaudoin
Copy link
Author

Just bringing attention back to this issue at the 3 week mark.

@yankeeinlondon
Copy link
Sponsor Collaborator

@AaronBeaudoin please try Release v0.22.0 and see if it fixes your error? If not then do note @brillout comment that there error is directly related to a different repo. Reopen if it is still an issue ok?

@brillout
Copy link

brillout commented Aug 30, 2023

The latest tag still points to the 0.21.x release branch. So I guess the 0.22.x branch is beta? (I couldn't find any mention of 0.22.x in the readme.)

@yankeeinlondon
Copy link
Sponsor Collaborator

@brillout i've been trying to clear out some dependencies so I can do another release on this ... I had thought I'd released v22 though but I'll check in the next day or too. Sorry for the delays.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants