bridge icon indicating copy to clipboard operation
bridge copied to clipboard

Support for vue runtime compiler

Open LionelPaulus opened this issue 2 years ago • 3 comments

Environment

Reproduction

Same as in this issue: https://github.com/nuxt/nuxt/issues/13843#issue-1549581747

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 avatar Jan 09 '24 15:01 LionelPaulus

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

LionelPaulus avatar Jan 09 '24 15:01 LionelPaulus

Hi :wave:

I don't have the issue on your stackblitz 🤔

huang-julien avatar Jan 09 '24 22:01 huang-julien

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)

jcwieme avatar Jan 10 '24 09:01 jcwieme