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

vite 6 breaks deno support when npm: specifer is used in config file #18822

Closed
7 tasks done
kazushisan opened this issue Nov 28, 2024 · 0 comments · Fixed by #18823
Closed
7 tasks done

vite 6 breaks deno support when npm: specifer is used in config file #18822

kazushisan opened this issue Nov 28, 2024 · 0 comments · Fixed by #18823

Comments

@kazushisan
Copy link
Contributor

kazushisan commented Nov 28, 2024

Describe the bug

Vite fails to run on Deno after upgrading to v6 when the config file includes an import statement with the npm: specifier.

I think I have a solution so I'd like to work on a patch!

Reproduction

https://github.com/kazushisan/vite-v6-deno-bug

Steps to reproduce

using the following config:

import { defineConfig } from 'npm:vite@6'
import react from 'npm:@vitejs/plugin-react'

// @deno-types="npm:@types/react@18.3.3"
import 'npm:react@18.3.1';
// @deno-types="npm:@types/react-dom@18.3.0"
import 'npm:react-dom@18.3.1'

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [react()],
})

execute the following command:

deno run -A --node-modules-dir npm:vite@5 dev

will work as expected, however the if I change the version to v6, vite will throw an error.

deno run -A --node-modules-dir npm:vite@6 dev
TypeError: [ERR_UNSUPPORTED_ESM_URL_SCHEME] Only file and data URLs are supported by the default ESM loader.

System Info

vite v6.0.1
deno v2.0.6

Used Package Manager

N/A

Logs

No response

Validations

@kazushisan kazushisan changed the title vite 6 breaks deno support vite 6 breaks deno support when npm: specifer is used in config file Nov 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant