Replies: 1 comment
-
At the moment native web components don't play too well with SSR. You'll have to check if it's running on the client first. Your if (process.client) {
const { MinzeElement } = await import('minze')
class MyTest extends MinzeElement {
html = () => 'Hello Minze!'
}
MyTest.define()
} You must also add the following setting to your Nuxt config to indicate custom web components to Vue. (Vue docs) export default defineNuxtConfig({
...
vue: { compilerOptions: { isCustomElement: (tag) => tag.includes('my-') } }
...
}) Here's a working StackBlitz example |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I love the syntax of Minze but when I try to integrate Minze with my Nuxt 3 (SSR) project, I got this error
HTMLElement is not defined
my-test.ts
nuxt.config.ts
app.vue
Beta Was this translation helpful? Give feedback.
All reactions