You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using @sveltejs/adapter-node v1.1.6 fails with a cryptic error message when trying to use the handler with the inbuilt node http package, but works with express.
Error: Not found: /
at resolve (file:///project/build/server/index.js:3178:18)
at resolve (file:///project/build/server/index.js:3045:34)
at #options.hooks.handle (file:///project/build/server/index.js:3223:59)
at respond (file:///project/build/server/index.js:3043:43)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Array.ssr (file:///project/build/handler.js:21839:3)
The path property isn't available on the IncomingMessage object for the native server but there is a pseudo-private _parsedUrl.pathname property. Although, I think the two properties have different semantics when used within express/polka middlewares mounted with different base paths.
Edit: the _parsedUrl property is added by sirv and not a node thing so the question is whether to rely on @polka/url and reuse the already parsed URL or use parse from node:url (which is going through Schrodinger's deprecation).
Describe the bug
Using
@sveltejs/adapter-node
v1.1.6 fails with a cryptic error message when trying to use the handler with the inbuilt node http package, but works with express.Reproduction
This fails:
This works:
Logs
Error: Not found: / at resolve (file:///project/build/server/index.js:3178:18) at resolve (file:///project/build/server/index.js:3045:34) at #options.hooks.handle (file:///project/build/server/index.js:3223:59) at respond (file:///project/build/server/index.js:3043:43) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async Array.ssr (file:///project/build/handler.js:21839:3)
System Info
Severity
serious, but I can work around it
Additional Information
Rolling back to
@sveltejs/adapter-node
v1.1.5 works.I don't want to add express as an extra dependency and the real server script includes other things (static file caching, proxy and http compression)
The text was updated successfully, but these errors were encountered: