Support for vue runtime compiler
Environment
- Operating System:
Darwin - Node Version:
v18.18.0 - Nuxt Version:
2.17.2 - CLI Version:
3.10.0 - Nitro Version:
2.8.1 - Package Manager:
[email protected] - Builder:
webpack - User Config:
bridge,alias,modern,ssr,components,head,css,loading,plugins,render,router,modules,buildModules,image,runtimeConfig,env,styleResources,vue,build,hooks,serverHandlers,devServerHandlers,devServer,typescript,nitro - Runtime Modules:
[email protected],@nuxtjs/[email protected],@nuxtjs/[email protected],[email protected] - Build Modules:
(),@nuxt/[email protected],~/modules/generate-redirects,@storyblok/nuxt-2/[email protected],@nuxt/[email protected]
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
- Run
npm run build - Run
npm run start - Load the homepage
- 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
@huang-julien as you are both the author and the solver of the original issue, maybe you can help? 🙏
Hi :wave:
I don't have the issue on your stackblitz 🤔
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)