Hello! I'm developing a website using Nuxt 3 and I keep getting this error on my console every time I render a page with the SliceZone component:
Uncaught (in promise) SyntaxError: The requested module '/_nuxt/node_modules/.cache/vite/client/deps/@prismicio_client.js?v=8a196fb6' does not provide an export named 'Content'
I think it refers to the line that's automatically added at the top of each slice setup script:
<script setup lang="ts">
import { type Content } from '@prismicio/client'
/* ... slice props */
</script>
Any ideas on how to fix this? This happens on every website I'm working on currently. I don't know if it's related to the fact that I don't use typescript in the rest of my .vue
files (layouts, pages, components, composables).
I hope I don't have to go through every slice's index.vue
file and remove the typescript statements, as I have already created a lot of slices.
The relevant packages' versions in my package.json
look like:
"devDependencies": {
"@nuxt/devtools": "latest",
"@nuxt/eslint-config": "^0.2.0",
"@nuxtjs/eslint-module": "^4.1.0",
"@nuxtjs/prismic": "^3.1.0",
"@slicemachine/adapter-nuxt": "^0.3.28",
"eslint": "^8.53.0",
"nuxt": "^3.8.2",
"slice-machine-ui": "^1.21.2",
"vue": "^3.3.11",
"vue-router": "^4.2.5"
}
Edit / Update: If I remove the typescript portion to a slice's index.vue
file's setup script and leave it like so:
<script setup>
defineProps(getSliceComponentProps(['slice', 'index', 'slices', 'context']))
</script>
It does get rid of the error, if that helps further clear up the issue.