-
Notifications
You must be signed in to change notification settings - Fork 27.2k
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
[NEXT-1336] Cannot run with custom https at localhost #51684
Comments
I'm also receiving an @ijjk Looking through the release notes for
|
I have been unable to update from
Interestingly, this error only manifests itself when I run
I have reverted the version for now, my current best guess is that the error is related to #51378. |
Got the same issue, stuck at |
Lol 4 minutes later, got it working by checking the code of #51378 . |
Edit: It seems that this workaround is no longer needed for our apps as of WorkaroundI can confirm, switching our const app = next({
- hostname: 'localhost',
+ // Use '127.0.0.1' instead of 'localhost' to temporarily work around issues
+ // with ECONNREFUSED (connection refused) errors with high port numbers
+ // https://github.com/vercel/next.js/issues/51684#issuecomment-1609345705
+ //
+ // TODO: Revert to 'localhost' when the issue is resolved https://github.com/vercel/next.js/issues/51684
+ hostname: '127.0.0.1', Thanks for the tip @greifmatthias 🙌 I guess this bug should probably stay open though, since it's still broken for anyone using |
This is particularly annoying problem for You can overwrite it with Also the static and public folders should have an option to be symlinked in the config in my opinion. |
I'm not confident this is the solution. What about when you deploy it? How will it bind to Trying to deploy with this configuration on fly.io, for instance, gives me
|
I don't know what you mean with this, but I can confirm that deploying our app to production (it is a Custom Server with Express in front of it, deployed to Render) works for us. Maybe not a solution for non-Custom Server deployments? Maybe some other people who added a thumbs-up to my post can respond about whether deploying to production worked for them? (and which hosting provider / configuration, if possible) |
@karlhorky Yeah, I realize this was my issue: #52215 (comment) Sorry for the confusion! |
So, I am not sure if this falls into the same category. I added a parameter to const targetUrl = `http://${targetHost === "localhost" ? "127.0.0.1" : targetHost}:${routerPort}${req.url || "/"}`; that when passed to const parsedTargetUrl = new URL(targetUrl);
parsedTargetUrl.hostname = "127.0.0.1"; would be causing the below issue
does anybody know how to host the site locally like the older nextjs servers? |
I know this might be completely unrelated but I was trying to do this on my own cloud and faced this issue with
I solved this by switching to
Just keeping this comment here in case it benefits someone. |
For me it was using |
Documenting for those that run into it. In our case, we're building using
To fix this we changed our Dockerfile's CMD from:
to
|
I have this same similar problem, with the following version: "14.0.2". I tried to downgrade the nodejs version to 16 but the next 14 does not allow it. any solution? Make a custom server? Where is the server.ts placed within src or the root? Is there any solution?
It works correctly when I work with "npm run dev". but to move it to production "npm run build" gives me problems. I was looking through my code and the problem is this line of code.
when I place another enpoint api, which is external to the project. the build is correct. but placing localhost:3000 gives that problem, that means that during the compilation it makes the request to know if the endpoint is working. but how is it down or not working because I am using next using frontend and backend on the same localhost. There is a way to execute "npm run build" ignoring the fetches or verification of endpoints or api???. |
Running into a similar issue with Nginx. We're using Nginx as a load balancer but ever since 13.4.13 ~ we're seeing the following error:
We're using Anyone know how to fix it? |
did you ever find a solution? I'm facing the same issue |
Yes and no. It is not a bug, simply next 14, it does not support this functionality. Maybe in the future it can do so, since currently next has static render, so it downloads the files but since the server with port 3000 is not up, it cannot download it. So this feature is not supported, it only works in development (npm run dev) maybe it can be done in the future. |
Verify canary release
Provide environment information
Operating System: Platform: darwin Arch: arm64 Version: Darwin Kernel Version 23.0.0: Tue Jun 13 21:16:44 PDT 2023; root:xnu-10002.0.116.505.3~3/RELEASE_ARM64_T6000 Binaries: Node: 18.16.0 npm: 9.5.1 Yarn: 1.22.19 pnpm: 8.6.2 Relevant packages: next: 13.4.7 eslint-config-next: 13.4.7 react: 18.2.0 react-dom: 18.2.0 typescript: 5.0.4
Which area(s) of Next.js are affected? (leave empty if unsure)
Middleware / Edge (API routes, runtime)
Link to the code that reproduces this issue or a replay of the bug
https://app.replay.io/recording/cannot-start-serverjs-at-localhost--df722455-73b5-4762-9a1a-aa18008a907c
To Reproduce
I have custom server to run https at local host as bellow, it's works well with pervious next version. But it's occurs on v13.4.7
Describe the Bug
Expected Behavior
Expect it will run without Error:
Which browser are you using? (if relevant)
No response
How are you deploying your application? (if relevant)
No response
NEXT-1336
The text was updated successfully, but these errors were encountered: