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

Does not work in Sveltekit running on Deno #701

Open
jakubdonovan opened this issue Oct 16, 2024 · 3 comments
Open

Does not work in Sveltekit running on Deno #701

jakubdonovan opened this issue Oct 16, 2024 · 3 comments

Comments

@jakubdonovan
Copy link

Describe the bug
Does not work in sveltekit running on Deno.

To Reproduce
Steps to reproduce the behavior:
deno install npm:@unpic/svelte

import { Image } from '@unpic/svelte';

<Image
	src={property.assets.images.find((img) => img.is_primary)?.asset_url}
	layout="constrained"
	width={800}
	height={600}
	alt="A lovely bath"
/>

02:50:21 [vite] hmr update /src/lib/components/PropertyCard.svelte, /src/app.pcss (x8)
Error: Unsupported: {
"kind": "external",
"specifier": "file:///Users/jakubdonovan/Documents/code/phuketkeyDeno/node_modules/.deno/@unpic[email protected]/node_modules/@unpic/core/dist/core.mjs"
}
at resolveDeno (file:///Users/jakubdonovan/Documents/code/phuketkeyDeno/node_modules/.deno/@deno[email protected]/node_modules/@deno/vite-plugin/dist/resolver.js:6
3:11)
at Object.runMicrotasks (ext:core/01_core.js:672:26)
at processTicksAndRejections (ext:deno_node/_next_tick.ts:57:10)
at runNextTicks (ext:deno_node/_next_tick.ts:75:3)
at eventLoopTick (ext:core/01_core.js:182:21)
at async resolveViteSpecifier (file:///Users/jakubdonovan/Documents/code/phuketkeyDeno/node_modules/.deno/@deno[email protected]/node_modules/@deno/vite-plugin/dis
t/resolver.js:89:39)
at async ResolveIdContext.resolveId (file:///Users/jakubdonovan/Documents/code/phuketkeyDeno/node_modules/.deno/@deno[email protected]/node_modules/@deno/vite-plug
in/dist/resolvePlugin.js:16:20)
at async PluginContainer.resolveId (file:///Users/jakubdonovan/Documents/code/phuketkeyDeno/node_modules/.deno/[email protected]/node_modules/vite/dist/node/chunks/dep-CDn
G8rE7.js:48952:22)
at async ModuleGraph._resolveUrl (file:///Users/jakubdonovan/Documents/code/phuketkeyDeno/node_modules/.deno/[email protected]/node_modules/vite/dist/node/chunks/dep-CDnG8
rE7.js:62571:41)
at async ModuleGraph.getModuleByUrl (file:///Users/jakubdonovan/Documents/code/phuketkeyDeno/node_modules/.deno/[email protected]/node_modules/vite/dist/node/chunks/dep-CD
nG8rE7.js:62322:19) {
stack: "Error: Unsupported: {\n" +
' "kind": "external",\n' +
' "specifier": "file:///Users/jakubdonovan/Documents/code/phuketkeyDeno/node_modules/.deno/@unpic[email protected]/node_modules/@unpic/core/dist/core.mjs"\n' +
"}\n" +
" at resolveDeno (file:///Users/jakubdonovan/Documents/code/phuketkeyDeno/node_modules/.deno/@deno[email protected]/node_modules/@deno/vite-plugin/dist/resolver
.js:63:11)\n" +
" at Object.runMicrotasks (ext:core/01_core.js:672:26)\n" +
" at processTicksAndRejections (ext:deno_node/_next_tick.ts:57:10)\n" +
" at runNextTicks (ext:deno_node/_next_tick.ts:75:3)\n" +
" at eventLoopTick (ext:core/01_core.js:182:21)\n" +
" at async resolveViteSpecifier (file:///Users/jakubdonovan/Documents/code/phuketkeyDeno/node_modules/.deno/@deno[email protected]/node_modules/@deno/vite-plugi
n/dist/resolver.js:89:39)\n" +
" at async ResolveIdContext.resolveId (file:///Users/jakubdonovan/Documents/code/phuketkeyDeno/node_modules/.deno/@deno[email protected]/node_modules/@deno/vite
-plugin/dist/resolvePlugin.js:16:20)\n" +
" at async PluginContainer.resolveId (file:///Users/jakubdonovan/Documents/code/phuketkeyDeno/node_modules/.deno/[email protected]/node_modules/vite/dist/node/chunks/de
p-CDnG8rE7.js:48952:22)\n" +
" at async ModuleGraph._resolveUrl (file:///Users/jakubdonovan/Documents/code/phuketkeyDeno/node_modules/.deno/[email protected]/node_modules/vite/dist/node/chunks/dep-
CDnG8rE7.js:62571:41)\n" +
" at async ModuleGraph.getModuleByUrl (file:///Users/jakubdonovan/Documents/code/phuketkeyDeno/node_modules/.deno/[email protected]/node_modules/vite/dist/node/chunks/d
ep-CDnG8rE7.js:62322:19)"
}

@ascorbic
Copy link
Owner

Hi. Can you provide a reproduction. I tried creating a basic SvelteKit site with Deno and it worked fine.

@jakubdonovan
Copy link
Author

jakubdonovan commented Oct 16, 2024

Hi. Can you provide a reproduction. I tried creating a basic SvelteKit site with Deno and it worked fine.

Hey, here it is https://github.com/jakubdonovan/sveltekitdenounpic

Once you've installed dependencies with deno install, start a development server:
deno task dev

@ascorbic
Copy link
Owner

This seems to be an issue with @deno/vite-plugin. If I disable that then it works fine. I'm not sure what the error means, but maybe you could report it on that repo. I'm happy to look into it if there's a bit more info on what the actual error is.

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

2 participants