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-1260] /app/not-found broken in standalone mode #50232
Comments
We noticed that it's the existence of a Example fix at klarstrup/next.js-repro-repo#1 |
Hey There ✋ ! It is working absolutely fine in my device. Operating System:
Binaries:
Relevant packages:
|
still applies as of next@13.4.4-canary.11 |
still applies as of next@13.4.4 |
Try to do |
Still applies as of next@13.4.5-canary.2 - in spite of both |
our is gone after setting absolute paths for everything on the server. so prefix with NEXT_PUBLIC_URL. Dunno if this is only one of the cause of this error. without we had the same issue |
Sorry, add that prefix where, @Inoir? https://github.com/klarstrup/next.js-repro-repo/tree/ERR_PACKAGE_PATH_NOT_EXPORTED |
Same here |
Can confirm this still applies as of |
Can confirm this still applies as of Sorry I sometimes forget to update the |
Hi, we hear you loud. As this bug is not fixed yet as the issue is still opening. We'll post update once it's closed with a PR or certain solution. No need to keep bumping it with comments, we'll working on it, thanks 😄 |
Sorry, it wasn't really my impression that this had been triaged at all and I wanted to make sure the relevancy was apparent when you eventually got to it. |
@klarstrup, just curious if this is now fixed for you. |
Yes and no, it is broken in a new way in |
Request data flow in the server ``` request ---> router worker (1) ---> ipc ---> render worker app (2) |-----> render worker pages (3) ``` When it's hitting `_next/*` unmatched routes in standalone server, it will render 404, but when you hit `_next/*` it will render app not-found as the app router is always enabled, but router worker isn't set up with require-hook for proper built-in react version, then the app-render will fail with `./server.edge` exports not found error. We detect if it's in the render worker, then do the app paths rendering instead of directly looking up for app paths in route worker. This could avoid unexpected accesses to the app-render Fixes #51482 Fixes #50232 Closes #51506 Reverts changes in #51172 fix NEXT-1260
This is not fixed as of #51611/ But as of #51506/ Error: connect ECONNREFUSED ::1:59104
at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1494:16) {
errno: -61,
code: 'ECONNREFUSED',
syscall: 'connect',
address: '::1',
port: 59104
} |
@klarstrup how did you bump to this network error? I tried your original reproduction from this issue with canary version it works for me |
No idea, this is with the repro repo above on the system described above: io@Ios-MacBook-Pro my-app % git status
On branch ERR_PACKAGE_PATH_NOT_EXPORTED
Your branch is up to date with 'origin/ERR_PACKAGE_PATH_NOT_EXPORTED'.
nothing to commit, working tree clean
io@Ios-MacBook-Pro my-app % rm -rf .next node_modules && npm i next@canary && npm run build && node ./.next/standalone/server.js
added 40 packages, and audited 42 packages in 2s
5 packages are looking for funding
run `npm fund` for details
found 0 vulnerabilities
> build
> next build
- info Creating an optimized production build
- info Compiled successfully
- info Linting and checking validity of types
- info Collecting page data
- info Generating static pages (3/3)
- info Finalizing page optimization
Route (app) Size First Load JS
─ ○ /_not-found 0 B 0 B
+ First Load JS shared by all 77.6 kB
├ chunks/769-f51582f2b9b00a6b.js 25.2 kB
├ chunks/bce60fc1-49ee79ad31766ac6.js 50.5 kB
├ chunks/main-app-5537570c1c769cc0.js 217 B
└ chunks/webpack-bf1a64d1eafd2816.js 1.61 kB
Route (pages) Size First Load JS
─ ○ /404 182 B 75.4 kB
+ First Load JS shared by all 75.2 kB
├ chunks/framework-8883d1e9be70c3da.js 45 kB
├ chunks/main-f21a854e626768e2.js 28.4 kB
├ chunks/pages/_app-998b8fceeadee23e.js 195 B
└ chunks/webpack-bf1a64d1eafd2816.js 1.61 kB
○ (Static) automatically rendered as static HTML (uses no initial props)
Listening on port 3000 url: http://localhost:3000
Error: connect ECONNREFUSED ::1:49756
at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1494:16) {
errno: -61,
code: 'ECONNREFUSED',
syscall: 'connect',
address: '::1',
port: 49756
}
Error: connect ECONNREFUSED ::1:49756
at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1494:16) {
errno: -61,
code: 'ECONNREFUSED',
syscall: 'connect',
address: '::1',
port: 49756
}
^C%
io@Ios-MacBook-Pro my-app % npx next info
Operating System:
Platform: darwin
Arch: arm64
Version: Darwin Kernel Version 22.5.0: Mon Apr 24 20:52:24 PDT 2023; root:xnu-8796.121.2~5/RELEASE_ARM64_T6000
Binaries:
Node: 18.15.0
npm: 9.5.0
Yarn: 1.22.19
pnpm: 8.3.1
Relevant packages:
next: 13.4.8-canary.1
eslint-config-next: N/A
react: 18.2.0
react-dom: 18.2.0
typescript: N/A
io@Ios-MacBook-Pro my-app % |
@klarstrup #51887 should hopefully resolve this issue :) This is likely due to Node.js 17 changing how it resolves 'localhost', so it might not be reproducible in older versions of Node.js. |
We have the same issue, using Next.js 13.4.7 and Node.js 18.16.0. With Node.js 16, it seems to work correctly, so it seems like it's the other way round and it's broken in newer versions of Node.js. That's also what the PR says, so I suppose it's just worded the wrong way round here. |
Inexplicably fixed for me as of |
@klarstrup the default host was changed to 127.0.0.1, which, uh, was quite crazy a change... |
That was included in the canary release, although it should be part of the release note. |
Not as anything resembling "Use 127.0.0.1 as the default host for the standalone server" at least, I think something might've gone awry generating the release note. |
@klarstrup Thanks for checking it's missing in release log, manually added them back for now. I'll follow up why it's lost 🙏 |
This closed issue has been automatically locked because it had no new activity for a month. 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
Which area(s) of Next.js are affected? (leave empty if unsure)
App directory (appDir: true), Standalone mode (output: "standalone")
Link to the code that reproduces this issue or a replay of the bug
https://github.com/klarstrup/next.js-repro-repo/tree/ERR_PACKAGE_PATH_NOT_EXPORTED
To Reproduce
Build and run the app:
npm i && npm run build && node ./.next/standalone/server.js
Request any path on the server, http://localhost:3000/ is a good choice.
Describe the Bug
any 404 page results in a bunch of failing script requests which result in ERR_PACKAGE_PATH_NOT_EXPORTED spam in server output:
Expected Behavior
no failing script requests and ERR_PACKAGE_PATH_NOT_EXPORTED spam in server output
Which browser are you using? (if relevant)
No response
How are you deploying your application? (if relevant)
No response
From SyncLinear.com | NEXT-1260
The text was updated successfully, but these errors were encountered: