Replies: 7 comments 10 replies
-
Hello. What is the |
Beta Was this translation helpful? Give feedback.
-
I was about to open same topic. I am using custom server similar to official example, will https://github.com/vercel/next.js/tree/canary/examples/custom-server-typescript |
Beta Was this translation helpful? Give feedback.
-
@blackmann did you ever figure this out? I'm guessing you may have to just copy your server into the standalone directory manually? |
Beta Was this translation helpful? Give feedback.
-
I tried to do this, but my problem was that the output file tracer throws out a lot of files from standalone/node_modules/next, including dist/server/next.js, but without this file it's very difficult to set up a custom server. |
Beta Was this translation helpful? Give feedback.
-
Perhaps one option is to set up a script or run a set of commands to insert and replace the contents of a ready-made server.js file into the server.js file that gets built in the standalone directory.
I'm going to try something similar, but using sed in order to append a few extra lines to the built server.js file. I reckon I'll run this on every deployment as part of the dockerfile (the plan is to dockerize our app). |
Beta Was this translation helpful? Give feedback.
-
I also encountered the same problem, is there any solution? |
Beta Was this translation helpful? Give feedback.
-
To get a custom server running with
Alternatively, you could bundle your server file (like @sadg mentioned). So the
|
Beta Was this translation helpful? Give feedback.
-
How to setup experimental
outputStandalone
with customserver.js
? It appears, the server.js included in the build is what comes from nextjs and not mine.Beta Was this translation helpful? Give feedback.
All reactions