-
Notifications
You must be signed in to change notification settings - Fork 44
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Version
module: 1.14.1 and 2.0.0
nuxt: 4.2.2
Nuxt configuration
export default defineNuxtConfig({
...,
modules: [
"@nuxtjs/sanity",
...
],
sanity: {
projectId: process.env.SANITY_PROJECT_ID,
apiVersion: process.env.SANITY_API_VERSION,
useCdn: process.env.SANITY_CDN,
dataset: process.env.SANITY_DATASET,
token:process.env.SANITY_TOKEN,
visualEditing: {
token: process.env.SANITY_TOKEN,
studioUrl: process.env.SANITY_STUDIO_URL,
zIndex: 51,
},
},
});
Build error:
Nuxt build error: Error: [vite]: Rollup failed to resolve import "react" from "/opt/build/repo/node_modules/@sanity/visual-editing/dist/index.js".
11:07:37 AM: │ This is most likely unintended because it can break your application at runtime.
11:07:37 AM: │ If you do want to externalize this module explicitly add it to
11:07:37 AM: │ `build.rollupOptions.external`
What i've tried:
- reluctantly i tried installing "react", "react-dom" and "react-is" to see if it would at least work until a better fix is available, but it resulted in this error:
Nuxt build error: Error: [vite:load-fallback] Could not load /opt/build/repo/utils/sanity-visual-editing-stub.ts (imported by node_modules/@nuxtjs/sanity/dist/runtime/composables/useSanityVisualEditing.js): ENOENT: no such file or directory, open '/opt/build/repo/utils/sanity-visual-editing-stub.ts'
- tried disabling visual editing altogether. Still seems to return the same react requirement errors. So looks like even without visual editing in use, nuxt/sanity requires it.
- I tried with both 1.14.1 and 2.0.0
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working