When I deploy my app with my sanity backend, I got that error: An error occurred while generating the chunk item [project]/node_modules/sanity/lib/index.mjs
I need help to fix that
Same issue here, my Sanity Studio is embedded into the app, I’ve followed standard creation steps following
npx create-next-app@latest
npx create-sanity@latest
Thanks for any help!
> Build error occurred [Error: Turbopack build failed with 2 errors:
./node_modules/sanity/lib/index.mjs
Code generation for chunk item errored
An error occurred while generating the chunk item [project]/node_modules/sanity/lib/index.mjs [app-client] (ecmascript) <locals>
An error occurred while generating the chunk item [project]/node_modules/sanity/lib/index.mjs [app-client] (ecmascript) <locals>
An error occurred while generating the chunk item [project]/node_modules/sanity/lib/index.mjs [app-ssr] (ecmascript) <locals>
An error occurred while generating the chunk item [project]/node_modules/sanity/lib/index.mjs [app-ssr] (ecmascript) <locals>
Error: Command "npm run build" exited with 1
I had exactly the same error, both when deploying the project or attempting to build locally. However I noticed that if I tried building the project without using Turbopack then I had no issues either locally or when deploying the project.
Same here, seems like there’s some internal conflict? I’m surprised there’s not many cases of this issue being brought up—guess it’s either working with webpack or keeping the studio separated.
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.