Next.js Discord

Discord Forum

Error: Cannot find module ‘styled-jsx/package.json’ when deploying from a monorepo using pnpm

Unanswered
Asiatic Lion posted this in #help-forum
Open in Discord
Asiatic LionOP
I have a NextJS 14 app i’m trying to deploy to an Azure web app service. I’ve packaged up the app using the default build mode. When i push files and node_modules up to azure and try running i get the error in the title.

Testing the deploy locally, it seems to be related to the fact that i’m using pnpm deploy to create the dist version of the app i’m sending to azure. I can see the styles-jsx pkg in node_modules but it’s symlinked by pnpm into the .pnpm folder.

The error seems to be coming from this spot:

https://github.com/vercel/next.js/blob/canary/packages/next/src/server/require-hook.ts#L18

so i’m sure that the resolve is t working right. it when i build/start locally without “deploying” everything works.

I’ve also tried output:standalone and get the same error too.

Anyone know of a fix or anything I can try?

0 Replies