Replies: 16 comments 6 replies
-
I have this same error, did you find a fix? |
Beta Was this translation helpful? Give feedback.
-
Has anyone managed to make this work? |
Beta Was this translation helpful? Give feedback.
-
This is still a problem! I am getting stupid standalone outputs which is a pain to manage. |
Beta Was this translation helpful? Give feedback.
-
Been a few months since last bump, and I can report that this continues to be a problem on |
Beta Was this translation helpful? Give feedback.
-
I get an error in the same case:
|
Beta Was this translation helpful? Give feedback.
-
The problem is in a monorepo setup, Next.js produces a If you
The root The possible workaround for this is to change the Dockerfile commands in a way that includes the root The final folder structure should be:
This workaround is cumbersome and feels hacky. This goes against the idea of the "standalone" directory which can be deployed as is. I think Next.js has to produce the same output as it would in a non-monorepo setup. |
Beta Was this translation helpful? Give feedback.
-
In case it helps anyone, here's a dockerfile for a turbo monorepo using the "single dockerfile in the root of the repo" guidance.
the redundant
|
Beta Was this translation helpful? Give feedback.
-
(just commenting to link this discussion with issue #56823) |
Beta Was this translation helpful? Give feedback.
-
I see there are 2 discussions in this thread, and the original one remains unanswered. I am facing the same issue, having "partially installed" dependencies in the root node_modules that will break the application on run time. In my case, the package creating the issue is next-intl, but what's even weirder, it only happens for certain versions, and after comparing the code changes between them, I cannot see any indication of why this is happening. So, as a recap, when building the application with ![]() I hope this thread does not remain dead for another 2 years... |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
Hope this helps someone. |
Beta Was this translation helpful? Give feedback.
-
i was working with the turbo repo with standalone next app, i got it working👍
|
Beta Was this translation helpful? Give feedback.
-
I wonder if there is a better wat for NX nowadays, anyone have an idea? |
Beta Was this translation helpful? Give feedback.
-
My working dockerfile for nx monorepo: The key is to copy
|
Beta Was this translation helpful? Give feedback.
-
Adding more confusion & breadcrumbs to the mix... on Next 14.2.25 having to also symlink to
where the |
Beta Was this translation helpful? Give feedback.
-
I didn’t dig too deep into that issue, but from what I can see, it looks like the problem is tied to where the lock file is and what’s in it. In a monorepo, if there’s a lock file in the package, the standalone output goes right under standalone. But ideally, the lock file should be at the root of the monorepo, which means the standalone folder will have subfolders like /app/docs. Most of the time, I fixed this by deleting some lock files that were probably misplaced in the packages. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I know this has been brought up a few times, but I ran into some weird issues with the standalone build feature in a monorepo.
I couldn't get it to work without a few changes. My app package is called
dashboard
here. I'm using Yarn v1 workspaces.Basically, I had to move everything into the
standalone/packages/dashboard
directory, and use the server.js there.If I tried to move server.js to root, it said it couldn't find a production next build.
If I didn't move the static files into the packages, I was getting 404s for every chunk.
For some reason I had partially built dependencies in the packages directory that I had to remove. I should probably move these to the root package.json, but I'm not sure if this was something else.
So yeah, this was weird. Am I missing something? Is this something solvable in documentation or directly in next.js?
Beta Was this translation helpful? Give feedback.
All reactions