Hong MinheeH
Denoβ€’6mo ago
Hong Minhee

Issues with Vite SSR and workspace imports in Deno β€” Need guidance on deno-vite-plugin usage

Hi everyone! πŸ‘‹

I'm currently working with Deno (2.3.7) + Vite (v6.3.5) and running into some issues that I hope you can help me with.

Current Setup

- Deno 2.3.7 with Vite 6.3.5
- Using SSR
- Workspace with multiple members
- Tried deno-vite-plugin v1.0.5

Issues I'm Facing


1. Workspace module imports failing in SSR


When doing SSR, I can't import modules from other workspace members. I get this error:

Cannot find module '@workspace/member/mod' imported from '/.../file.tsx'


2. npm: specifier issues with deno-vite-plugin


I thought using deno-vite-plugin might solve the workspace issue, but when I tried it, I encountered:

[ERR_UNSUPPORTED_ESM_URL_SCHEME] Only file and data URLs are supported by the default ESM loader. Received protocol 'npm'


Questions


1. Do I still need deno-vite-plugin? Vite seems to have some level of Deno support now, but I'm unclear if the plugin is still necessary for proper functionality.
2. Why do npm: imports fail with deno-vite-plugin? This seems counterintuitive since Deno natively supports npm: specifiers.

Has anyone encountered similar issues or have insights on the current state of Vite + Deno integration? Any guidance would be greatly appreciated!

Thanks in advance! πŸ™
Was this page helpful?