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

Support for vue runtime compiler #1054

Open
LionelPaulus opened this issue Jan 9, 2024 · 3 comments
Open

Support for vue runtime compiler #1054

LionelPaulus opened this issue Jan 9, 2024 · 3 comments

Comments

@LionelPaulus
Copy link

LionelPaulus commented Jan 9, 2024

Environment

Reproduction

Same as in this issue: nuxt/nuxt#13843 (comment)

Can be reproduced in this Stackblitz also: https://stackblitz.com/edit/stackblitz-starters-ohstyk?file=components%2FTutorial.vue

  1. Run npm run build
  2. Run npm run start
  3. Load the homepage
  4. You should get a "Cannot convert object to primitive value" error

Describe the bug

This has been fixed for Nuxt 3 in this PR but how to solve the issue with Nuxt-bridge?

I tried using nuxt-runtime-compiler but it didn't work.

Thanks!

Additional context

No response

Logs

No response

@LionelPaulus
Copy link
Author

@huang-julien as you are both the author and the solver of the original issue, maybe you can help? 🙏

@huang-julien
Copy link
Member

Hi 👋

I don't have the issue on your stackblitz 🤔

@jcwieme
Copy link

jcwieme commented Jan 10, 2024

Hi @huang-julien 👋
The error appears when we build for ssr and preview (npm run build && node .output/server/index.mjs)
If the string we're passing through contains only Vue components, it works.

<div>
  <component is="nuxt-logo" />
  <NuxtLogo />
</div>

But if you mix classic html tags with text, you'll get an error.

<div>
  <component is="nuxt-logo" />
  <NuxtLogo2 />
  if we add <bold>text</bold>
</div>

[nuxt] [request error] [unhandled] [500] Cannot convert object to primitive value
at RegExp.test ()
at ./.output/server/chunks/handlers/renderer.mjs:557:43340
at Object.chars (./.output/server/chunks/handlers/renderer.mjs:557:43667)
at Kr.warn (./.output/server/chunks/handlers/renderer.mjs:557:40751)
at Kr (./.output/server/chunks/handlers/renderer.mjs:557:41891)
at to (./.output/server/chunks/handlers/renderer.mjs:557:64137)
at t (./.output/server/chunks/handlers/renderer.mjs:557:64679)
at ./.output/server/chunks/handlers/renderer.mjs:557:63648
at lo (./.output/server/chunks/handlers/renderer.mjs:557:66092)
at go (./.output/server/chunks/handlers/renderer.mjs:557:69819)

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

No branches or pull requests

3 participants