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

Getting an error with deno run --allow-env --allow-read --allow-net path/to/build/index.js #39

Open
xanderjakeq opened this issue Feb 1, 2023 · 8 comments

Comments

@xanderjakeq
Copy link

If you want to use a built-in Node module, add a "node:" prefix (ex. "node:assert").
    at file:////sveltekit/server/chunks/firebaseAdmin-918fac7a.js:20:26
      const module = await import('./hooks.server-8f6f964b.js');

I get this error after building with svelte-adapter-deno. Not sure what I did wrong.

@jpaquim
Copy link
Contributor

jpaquim commented Feb 1, 2023

Hey @xanderjakeq are you trying to import a node module, or is it one of your package dependencies that is importing a node-specific dependency? If so, you may need to patch it to import using the node: specifier for Deno compatibility.

@xanderjakeq
Copy link
Author

I don't know.. i think it's my dependencies.
This is happening in the build files, so am I editing them directly?

@oskarhane
Copy link

I've got a bunch of these on a project I'm trying this out with as well. For assert, fs, buffer etc.
I suppose this adapter only checks the direct dependencies, and not deps of deps?

@drewbitt
Copy link

drewbitt commented Feb 2, 2023

This is pretty much where we are at in #38

@jpaquim
Copy link
Contributor

jpaquim commented Feb 6, 2023

It does seem to be related, and maybe related to some difference in bundling the built-in node: modules between rollup and esbuild. @drewbitt, @oskarhane, @xanderjakeq could you maybe provide a minimal reproduction just to help with the debugging and to understand if the root cause is the same for your issues?

@leo-lox
Copy link

leo-lox commented Jan 3, 2024

have a simmilar issue

TypeError: Relative import path "dns" not prefixed with / or ./ or ../
If you want to use a built-in Node module, add a "node:" prefix (ex. "node:dns").

code is pretty simple just a +server.ts with

export async function GET(request: RequestEvent) {
	const nameParam = request.url.searchParams.get('name');

	if (!nameParam || nameParam === '_') {
		return defaultResponse();
	}
	// do stuff and send response
	...
}
deno 1.39.1 (release, x86_64-pc-windows-msvc)
v8 12.0.267.8
typescript 5.3.3
		"svelte": "^4.2.7",
		"svelte-adapter-deno": "^0.9.0",
		"@sveltejs/kit": "^2.0.0",

I tried adding node:dns but same issue

@drewbitt
Copy link

drewbitt commented Jan 3, 2024

@leo-lox according to dbushell/sveltekit-adapter-deno#5 (comment), this project will likely not receive any updates any time soon and the other adapter is a bit more up to date with fixes.

@leo-lox
Copy link

leo-lox commented Jan 3, 2024

thx, I did not see that

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants