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
Attempting to run adapter-node SvelteKit apps using Deno 2 fails due to inconsistent imports in the generated handler.js file.
Reproduction
Given any new or preexisting SvelteKit app using adapter-node:
Run the build task.
Navigate to the build (or whatever your output directory is called).
Run deno run ./index.js (Make sure you have Deno installed).
The command errors out, and the app doesn't run.
Logs
error: Relative import path "path" not prefixed with / or ./ or ../
hint: If you want to use a built-in Node module, add a "node:" prefix (ex. "node:path").
at file:///[REDACTED]/build/handler.js:7:42
I am testing running my SvelteKit apps with the just-released Deno 2 runtime. Sadly, I cannot easily do that due to the inconsistent imports in handler.js. Some are prefixed with node: and some aren't, which causes Deno to log the following message and fail:
error: Relative import path "path" not prefixed with / or ./ or ../
hint: If you want to use a built-in Node module, add a "node:" prefix (ex. "node:path").
at file:///[REDACTED]/build/handler.js:7:42
The line in question is:
// handler.jsimport{resolve,join,normalize}from'path';// Line 7
And above it are two other lines that cause the same issue:
// handler.jsimport*asfsfrom'fs';// Line 5import{readdirSync,statSync}from'fs';// Line 6
Surprisingly, all other imports are prefixed with node: or are relative, so they don't cause any issues. Indeed, manually modifying the handler.js file after each build fixes the problems and makes the SvelteKit app run flawlessly. But that becomes tedious too quickly.
The text was updated successfully, but these errors were encountered:
I'm removing the 'blocked by upstream' label. It looks like this is pretty easy to take care of in our own build process for the runtime parts of the adapter - #12785.
Describe the bug
Attempting to run
adapter-node
SvelteKit apps using Deno 2 fails due to inconsistent imports in the generatedhandler.js
file.Reproduction
Given any new or preexisting SvelteKit app using
adapter-node
:build
task.build
(or whatever your output directory is called).deno run ./index.js
(Make sure you have Deno installed).Logs
System Info
Severity
serious, but I can work around it
Additional Information
I am testing running my SvelteKit apps with the just-released Deno 2 runtime. Sadly, I cannot easily do that due to the inconsistent imports in
handler.js
. Some are prefixed withnode:
and some aren't, which causes Deno to log the following message and fail:The line in question is:
And above it are two other lines that cause the same issue:
Surprisingly, all other imports are prefixed with
node:
or are relative, so they don't cause any issues. Indeed, manually modifying thehandler.js
file after each build fixes the problems and makes the SvelteKit app run flawlessly. But that becomes tedious too quickly.The text was updated successfully, but these errors were encountered: