ローリー Laurie
ローリー Laurie
NNuxt
Created by ローリー Laurie on 9/19/2024 in #❓・help
Exporting a custom element from a nuxt3 project
Hello, I'm trying to combine two projects. One is a Nuxt 3 project, the other is a Vue3 project. The Vue3 project uses a vite library build to export a few custom elements. I have copied these into the Nuxt project and got them working as part of the site, but I can't work out how to export them as custom elements, using a library build or similar. Has anyone done this with Nuxt? Any pointers on what to do?
build: {
lib: {
entry: [
resolve(__dirname, 'components/viewer/viewer.ts'),
],
fileName: (format, entryName) => {
return `${entryName}.js`
},
name: 'Viewer',
formats: ['es'],
},
},
build: {
lib: {
entry: [
resolve(__dirname, 'components/viewer/viewer.ts'),
],
fileName: (format, entryName) => {
return `${entryName}.js`
},
name: 'Viewer',
formats: ['es'],
},
},
I tried something like this in my vite config inside nuxt.config.ts (it works in the Vue project) but I couldn't get it to work.
1 replies
NNuxt
Created by ローリー Laurie on 6/25/2024 in #❓・help
"does not provide an export named 'Component' " error
I've been working on this bug for nearly a week and I can't make sense of what's going on: When I run this monorepo project and fire up the dev server things seem to work ok, but then I get this error:
SyntaxError: The requested module '/_nuxt/@fs/Users/laurie/WorkNow/.../project/node_modules/.pnpm/@[email protected]/node_modules/@firebase/component/dist/index.cjs.js' does not provide an export named 'Component'
SyntaxError: The requested module '/_nuxt/@fs/Users/laurie/WorkNow/.../project/node_modules/.pnpm/@[email protected]/node_modules/@firebase/component/dist/index.cjs.js' does not provide an export named 'Component'
I've tried fiddling around with the versions of different packages etc but nothing seems to work. I'm using Nuxt together with firebase and Vuefire.
Any ideas what I could investigate to try to find the source of the error?
4 replies