-
Notifications
You must be signed in to change notification settings - Fork 27.1k
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 13.4.13+ broke self-hosted docker setup #54133
Comments
We cannot recreate the issue with the provided information. Please add a reproduction in order for us to be able to investigate. Why was this issue marked with the
|
This comment was marked as off-topic.
This comment was marked as off-topic.
Very likely related to: #53367 |
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as spam.
Please read #54133 (comment) "same" and similar comments are unhelpful and we cannot investigate. We need to see your application code to be able to debug further. At the very least, paste in your Dockerfile |
// Dockerfile
|
ReproduceOpen https://test-server.lectr.ru/lectures/17 Expected: https://test-server.lectr.ru/lectures/17-chto-takoe-naivnoe-iskusstvo Result: http://172.18.0.5:3000/lectures/17-chto-takoe-naivnoe-iskusstvo |
Dockerfile
|
Logs
|
@balazsorban44 just a simple app created with create-next-app Build logs :
|
Logs
|
I had a similar issue on
|
doesn't work for me |
I have the same issue. After updating next.js to version 13.4.13, the Docker build stopped working, and the staging environment went down. I changed the HOSTNAME to 0.0.0.0. The build started working again, but dynamic routes with the following syntax stopped functioning: pages/blog/[slug].tsx My dockerfile
|
Could this be related to these changes #53131 ? |
This comment was marked as off-topic.
This comment was marked as off-topic.
Any urls with [] (%5B, %5D) return a 404 error which includes the generated js files for any dynamic page |
Having the same issues with ../../[slug].tsx route, tried specifying HOSTNAME in docker file but no success yet. |
No one care about this :( |
I currently don't have problems with I managed to solve most of the hydration issues by client rendering the I don't know the libraries you are using but I assume updating next won't solve the hydration errors as these libraries are the ones that should adopt the breaking changes of One way to solve the hydration issues is to you may need to dig deeper and solve the hydration issues |
and some extensions may cause such hydration problems, So you may disable all extensions while testing/developing |
The issue fixed for me after downgrading nextjs to 13.3.4 |
Fixed my API route redirect for now by building the URL using the request headers (which I think was mentioned in a different thread)
|
I have to downgrade to |
Likely cause: vercel/next.js#54133
Likely cause: vercel/next.js#54133
I had a similar issue and posted this question and answer on Stack Overflow Due to recent changes, you now need to add this line to your Dockerfile:
I don't know for sure, but if I had to guess, I think it's related to the change on this line of the pull request: https://github.com/vercel/next.js/pull/53131/files#diff-3a7de5f9ca3729cdc0a041e9d4c22391754e702ba49ba230daf55730bdc70d99R1975 I noticed that @m4salah made a pull request that fixed the issue in the docs for new projects using the with-docker example. Projects already using Docker and NextJS will need to add that line. The full, working Dockerfile example now includes that as the second-to-last line. This is the current snapshot of that example:
Hope this helps others! |
@LukeSchlangen this fixed it for me on |
Thanks! It was a team effort. I don't think I would have figured it out without @m4salah's pull request. I hope this works for most people! |
As a note, downgrading to version If you want to keep your packages up to date, updating the Dockerfile is a solution that should allow you to stay up to date with new releases. |
I still have the problem with next-auth. It redirects to Docker internal IP address or to HOSTNAME (if specified) when I try to sign in. |
Reproduction attemptBelow, I repost two reproduction scenarios I described in a comment that I made in the context of another issue regarding problems for self-hosted apps introduced by 13.4.13+. My original comment: #53171 (comment) Altough that issue was stated to be solved both problems I described are still present in Unfortunately, both of the scenarios can only be reproduced when hosting the app on a machine that is not your local computer. Below is the /** @type {import('next').NextConfig} */
const nextConfig = {
output: 'standalone',
serverActions: true,
}
module.exports = nextConfig For reproduction do the following:
In such an environment, the following 2 scenarios lead to problems: 1. Scenario - Internationalization middleware redirects to
|
This is my day. I declare |
This is an issue caused on a recent NextJS version upgrade: vercel/next.js#54133
Ensure you're using node >=18.17.1 as there was a memory leak with fetch in lower versions |
Ah, thank you; we're basing off |
* refactor: nextjs 13 migration * fix: nextjs13 migrations * fix(build): use correct reference to variable * fix(styles): use MUI recommended Nextjs13 approach As specified here: https://mui.com/material-ui/guides/next-js-app-router/ * fix(linter): add missing definitions from plugins * fix(ci): allow building with latest node * fix(linter): use general eslint disable rule * fix: tests * imp(build): enable `yarn` cache * build(docker): use correct `$PORT` and `$HOSTNAME` handling * fix(deploy): use `0.0.0.0` as hostname This is an issue caused on a recent NextJS version upgrade: vercel/next.js#54133 * fix(build): use a newer Nextjs version to fix route handlers * build(deps): update app dependencies * fix(styles): loader positioning * fix(ux): use numeric input for cedula field * feat: edge-csrf middleware applied * imp(csrf): just use type * feat(core): cookie middleware implementation Validate cookie on all api request * fix(api): getting `validated` query params Extracting `validated` queryparams in the Nextjs 13 way --------- Co-authored-by: Jeffrey Mesa <JeffreyArt@hotmail.com> Co-authored-by: Marluan Espiritusanto <marluanespiritusantoguerrero@gmail.com>
In case anyone looking at this thread is suffering from this, removing a trailing slash from our Nginx |
This closed issue has been automatically locked because it had no new activity for 2 weeks. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
Verify canary release
Provide environment information
Operating System: Platform: darwin Arch: arm64 Version: Darwin Kernel Version 22.5.0: Thu Jun 8 22:22:19 PDT 2023; root:xnu-8796.121.3~7/RELEASE_ARM64_T8103 Binaries: Node: 18.17.1 npm: 9.6.7 Yarn: N/A pnpm: 8.6.12 Relevant Packages: next: 13.4.16 eslint-config-next: 13.4.16 react: 18.2.0 react-dom: 18.2.0 typescript: 5.1.6 Next.js Config: output: standalone
Which area(s) of Next.js are affected? (leave empty if unsure)
Standalone mode (output: "standalone")
Link to the code that reproduces this issue or a replay of the bug
https://github.com/vercel/next.js/blob/canary/examples/with-docker/Dockerfile
To Reproduce
See description
Describe the Bug
I'm using dockerfile from the examples.
After upgrading to version 13.4.13-13.4.16, my application stopped working properly.
calling the 'router.push' function results in hard navigation
in middleware redirect
before: https://my-site.com/some-path
now: http://172.18.0.6:3000/some-path
Expected Behavior
13.4.12 behavior
Which browser are you using? (if relevant)
No response
How are you deploying your application? (if relevant)
self-hosted
The text was updated successfully, but these errors were encountered: