-
Notifications
You must be signed in to change notification settings - Fork 115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Nextjs SSR Build Fail in yarn monorepo #2834
Comments
Hi @itseasy21 👋🏽 I tested this out with the same folder structure of your application and did not run into this error. Can you provide a sample monorepo that reproduces this same behavior? |
Thanks for looking into this @hloriana More detailsEnvironment Vars
Amplify App Details
Build Logs |
Hi, @hloriana! were you able to reproduce the bug with the above repo, do you have any updates? |
I've just encountered the exact same issue with a sample nextjs app added to an existing yarn 3 - based monorepo. I think that the problem is that the
|
ah still running into this problem. how did you manage to solve this problem?
|
@itseasy21 are you still just using the workaround that you mentioned? |
@9oelM couldn't get any response from amplify so switched to Vercel |
My team also went to Vercel because of this. |
Hi folks, apologies for the oversight here. We recently launched monorepo support for Next.js applications using the following monorepo frameworks:
For anyone who was previously running into this issue, please redeploy your application. I tested this out with the sample app provided above and confirmed that the issue no longer persists. If anyone runs into another issue with hosting their monorepo application, please feel free to open a new issue with the bug report template and we will gladly assist. |
|
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Before opening, please confirm:
App Id
d1trrhbw32iorq
Region
us-east-1
Amplify Hosting feature
Monorepo
Describe the bug
We have a monorepo setup with 2 nextjs packages and 1 common UI packages.
The issue:
While installing the monorepo, yarn by default installs the packages in node_modules folder at the root directory of the repo. When the amplify build starts it is already in
packages/package1
directory and everything works fine until the next build finishes and SSR Build starts. At this point, as there is nonode_modules
in the current directory the SSR Build fails as it can't findnext
executable.Workaround
As a workaround, we are executing the command
cp -r ../../node_modules .
postyarn install
which makes the build go through, but this results in various warning messages of circular dependencies.Expected behavior
The SSR Build should be able to find the next executable from
../../node_modules
or there should be a way to set thenode_modules
path, like maybe using an env varAMPLIFY_NODE_MODULES_DIR
where we can set this.Reproduction steps
Create a yarn monorepo, make sure it's on latest yarn(3.2.1).
Create a monorepo structrure like:
Where app1 and app2 are nextjs projects
Deploy using the attached amplify.yml
Build Settings
Additional information
Yarn Version: 3.2.1
NextJS Version: 12.1
Error Log
Logs
The text was updated successfully, but these errors were encountered: