NuxtN
Nuxt14mo ago
6 replies
Justus G.

Error when using deployed version of Nuxt module with Sanity depdendencies

I am currently trying to use Sanity dependencies within a Nuxt module. The module works completely fine in the playground, but when deploying to npm, it breaks in my Nuxt 3 App. The server starts up and then throws "Cannot find module './cjs/react.development.js'" once a client connects to the app.

I installed the module in the Nuxt app like this:

"devDependencies": {
  "@sanity/types": "^3.68.3"
},
"dependencies": {
  "@devite/nuxt-sanity": "^2.0.1",
  "@nuxt/image": "^1.8.1",
  "@sanity/client": "^6.22.5",
  "@portabletext/vue": "^1.0.11",
  "nuxt": "^3.14.1592",
  "vue": "3.5.13",
  "vue-router": "^4.5.0"
}
Was this page helpful?