You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When deploying an opennext app that's inside of an npm monorepo using workspaces, a node_modules folder is not bundled in the open next server_functions folder as it is when building a nextjs app with open next outside of a monorepo (when there is a node_modules folder inside the nextjs root).
For instance, if we have a nextjs app located at applications/nextjs, and we run sst deploy from the monorepo root where the root package.json and sst.config.ts is located, the built app will not have any dependencies included and will not be able to run.
The text was updated successfully, but these errors were encountered:
jacksors
changed the title
node_modules not bundled with open next build when using npm monoreponode_modules not bundled with open next build when using npm monorepo/workspaces
Oct 18, 2024
jacksors
changed the title
node_modules not bundled with open next build when using npm monorepo/workspaces
Bug: node_modules not bundled with open next build when using npm monorepo/workspaces
Oct 18, 2024
I haven't tried it recently but usually it only bundles that directory if you have dependencies in the nodejs.install. Do you have something like that? Can I see your sst config for the Next.js site?
The workaround I'm currently using is just removing applications/web/ from my root package.json so the nextjs app's dependencies are handled separately from the rest of the monorepo's, but this breaks the automated deployment on the SST cosole since that only installs packages in the root directory.
When deploying an opennext app that's inside of an npm monorepo using workspaces, a
node_modules
folder is not bundled in the open nextserver_functions
folder as it is when building a nextjs app with open next outside of a monorepo (when there is anode_modules
folder inside the nextjs root).For instance, if we have a nextjs app located at applications/nextjs, and we run
sst deploy
from the monorepo root where the rootpackage.json
andsst.config.ts
is located, the built app will not have any dependencies included and will not be able to run.The text was updated successfully, but these errors were encountered: