kit: Seems adapter-node@1.3.0 handler.js does not load in express
Describe the bug
Upgrading from adapter-node@1.2.4 to 1.3.0, handler.js not runs in expressjs middleware.
Reproduction
Upgrade to adapter-node@1.3.0 and do npm run build
Logs
No error logs
System Info
System:
OS: Linux 3.10 CentOS Linux 7 (Core)
CPU: (4) x64 Intel Xeon Processor (Skylake, IBRS)
Memory: 777.02 MB / 15.51 GB
Container: Yes
Shell: 4.2.46 - /bin/bash
Binaries:
Node: 16.20.0 - /usr/bin/node
Yarn: 1.22.19 - /usr/bin/yarn
npm: 9.6.5 - /usr/bin/npm
pnpm: 8.6.5 - /usr/bin/pnpm
npmPackages:
@sveltejs/adapter-node: ^1.3.0 => 1.3.0
@sveltejs/kit: ^1.21.0 => 1.21.0
svelte: ^4.0.1 => 4.0.1
vite: ^4.3.9 => 4.3.9
Severity
blocking all usage of SvelteKit
Additional Information
No response
About this issue
- Original URL
- State: closed
- Created a year ago
- Reactions: 15
- Comments: 25 (6 by maintainers)
Links to this issue
Commits related to this issue
- [0.4.89] Drag to resize events in timeline, reverted svelte `adapter-node` (https://github.com/sveltejs/kit/issues/10299) Signed-off-by: revers3ntropy <josephcoppin@gmail.com> — committed to revers3ntropy/everywhen by revers3ntropy a year ago
- fix: dep update problem see https://github.com/sveltejs/kit/issues/10299 — committed to knrdl/hubleys-dashboard by knrdl a year ago
- Revert "chore: remove build step for adapter node" (#10314) This reverts commit 6b998513297fd03475acf0024d2d1c0c8dcb87f4 hotfix for #10299 — committed to sveltejs/kit by gtm-nayan a year ago
We reverted the change that caused this, 1.3.1 should not observe this issue. We’ll try to land the change again in a way that does not break. The underlying problem is a Rollup bug.
Well, I was deleted
node_modules
,package-lock.json
, reinstall npms, delete.svelte-kit
abuild
folders, and still the same issue.npm run preview
runs okRolling back to
adapter-node@1.2.4
fixes the issue.I can give you private access to our dev VM to connect your vscode through remote ssh credentials if this can help with the reproduction.
I am facing this issue too. I pinned the node adaptor to 1.2.4 for now and is working. (I have no other info to offer. there is no error, nothing shown. it just exits with 13 exit coe)
Someone on discord said it was stuck on the
await server.init()
line, I’m guessing the bundling probably introduces a circular import between the handler chunk and the hooks file which is dynamically imported inside server.init leading to a deadlock on the await.Last time me and @dominikg ran into this we used manualChunks to put everything from a dependency into its own chunk. I don’t know which one(s) we’d do that for here, so probably need a better way.
I’m sorry in advance - but I am in a hurry and I can’t provide a better reproduction right now.
With this package.json, I can reproduce the error described by @NormandoHall:
when I instead pin
adapter-node
to1.3.0
I can once again deploy our app:with
1.3.0
- I got zero output from my node container. none whatsoever.this is my
Dockerfile
:maybe this is not very helpful - but at least another data point.
the issue is known - we have countless reports and reproductions in this thread. maybe we can use reactions instead of posting the same type of messages over and over again? I have notifications turned on so I get notified when there is a fix out - it’s slightly annoying to get notified for every message reporting the same issue.
thanks in advance
I am seeing the same thing. Start with a working app. Upgrade only the node adaptor v1.3.0 and the app no longer runs, giving “Command failed with exit code 13”
This isn’t using Express, it’s using the node “http” package to host the handler. But trying to launch the app using
node build
just exits back to the terminal with no message at all.Reproduction repository: https://github.com/ollema/node-adapter-repro
Reproduction steps:
cd node-adapter-repro
andpnpm install
docker build -t node-adapter-repro . && docker run --rm -it node-adapter-repro
1.2.4
:pnpm add -D @sveltejs/adapter-node@1.2.4
docker build -t node-adapter-repro . && docker run --rm -it node-adapter-repro
againListening on 0.0.0.0:3000
Can you confirm @NormandoHall?
In the
README.md
for this repo I have also included every step needed to recreate a project with this issue from the initialpnpm create svelte@latest
step (I think).@ollema yes, there is no output:
UPDATE: Rolling back to 1.2.4:
Okay, so there is something strange going on for sure. Without changing package.json, I managed to get it working by removing routes/hooks/other things from my reproduction repo.
I will try to “bisect” to pin down what is needed to make it not work again
edit:
started working when I removed my
hooks.server.ts
:will continue to remove unrelated stuff and try to post a reproduction repo
With the above code, there is no
1
console output norlistening on port 13030
Commenting
import { handler } from './build/handler.js';
andapp.use(handler);
express runs and get the console output 1 andlistening on port 13030