vite 6 breaks deno support when npm:
specifer is used in config file #18822
Closed
Description
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
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- Make sure this is a Vite issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to vuejs/core instead.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- The provided reproduction is a minimal reproducible example of the bug.