Skip to content
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

sveltekit demo app dev server fails with bad resource ID #26341

Closed
nathanwhit opened this issue Oct 17, 2024 · 2 comments · Fixed by #26342
Closed

sveltekit demo app dev server fails with bad resource ID #26341

nathanwhit opened this issue Oct 17, 2024 · 2 comments · Fixed by #26342
Assignees
Labels
bug Something isn't working correctly node compat

Comments

@nathanwhit
Copy link
Member

repro:

❯ deno run -A npm:create-svelte@latest repro

create-svelte version 6.4.0

┌  Welcome to SvelteKit!
│
◇  Which Svelte app template?
│  SvelteKit demo app
│
◇  Add type checking with TypeScript?
│  Yes, using TypeScript syntax
│
◇  Select additional options (use arrow keys/space bar)
│  none
│
└  Your project is ready!
❯ cd repro
❯ deno i --allow-scripts
❯ deno task dev

Then navigate to the correct url in your browser (probably http://localhost:5173/). Fails with:

BadResource: Bad resource ID
    at TcpConn.setNoDelay (ext:deno_net/01_net.js:211:12)
    at TCP.setNoDelay (ext:deno_node/internal_binding/tcp_wrap.ts:229:28)
    at Socket.setNoDelay (node:net:595:20)
    at WebSocket.setSocket (file:///repro/node_modules/.deno/[email protected]/node_modules/vite/dist/node/chunks/dep-Cyk9bIUq.js:57417:35)
    at WebSocketServer.completeUpgrade (file:///repro/node_modules/.deno/[email protected]/node_modules/vite/dist/node/chunks/dep-Cyk9bIUq.js:59042:8)
    at WebSocketServer.handleUpgrade (file:///repro/node_modules/.deno/[email protected]/node_modules/vite/dist/node/chunks/dep-Cyk9bIUq.js:58967:10)
    at ServerImpl.hmrServerWsListener (file:///repro/node_modules/.deno/[email protected]/node_modules/vite/dist/node/chunks/dep-Cyk9bIUq.js:59217:13)
    at ServerImpl.emit (ext:deno_node/_events.mjs:393:28)
    at handler (node:http:1310:14)
    at ext:deno_http/00_serve.ts:369:24 {
  name: "BadResource"
}
Upgrade response was not returned from callback
@AllenAttuned
Copy link

I'm not sure if it would be related, but I'm getting the same error when starting up a fresh React SPA using: deno run --allow-read --allow-write --allow-env npm:create-vite-extra@latest. Downgrading from Deno 2.0.1 to 2.0.0 seems to resolve the issue.

Task dev deno run -A --node-modules-dir npm:vite

  VITE v5.4.9  ready in 65 ms

  ➜  Local:   http://localhost:3000/
  ➜  press h + enter to show help
BadResource: Bad resource ID
    at TcpConn.setNoDelay (ext:deno_net/01_net.js:211:12)
    at TCP.setNoDelay (ext:deno_node/internal_binding/tcp_wrap.ts:229:28)
    at Socket.setNoDelay (node:net:595:20)
    at WebSocket.setSocket (...)
    at WebSocketServer.completeUpgrade (...)
    at WebSocketServer.handleUpgrade (...)
    at ServerImpl.hmrServerWsListener (...)
    at ServerImpl.emit (ext:deno_node/_events.mjs:393:28)
    at handler (node:http:1310:14)
    at ext:deno_http/00_serve.ts:369:24
    at ext:deno_http/00_serve.ts:577:29
    at eventLoopTick (ext:core/01_core.js:175:7) {
  name: "BadResource"
}
Upgrade response was not returned from callback

@marvinhagemeister
Copy link
Contributor

@AllenAttuned That issue is tracked in #26343

bartlomieju pushed a commit that referenced this issue Oct 17, 2024
Fixes #26341.

We try to call `op_set_nodelay` on an `UpgradeStream`, which doesn't
support that operation.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working correctly node compat
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants