-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed as not planned
Labels
Description
Describe the bug
Related issue: nitrojs/nitro#448
When importing a module path with spaces, vitest will throw Error: [vite-node] Failed to load, but it works fine in node env.
Reproduction
Let's define a simple test dir/util.mjs
export default 123This file can be improved via Node.js:
const util = await import("file:///test/test%20dir/util.mjs")
console.log(util) // 123But when we import this file in vitest, we'll see error:
import { describe } from 'vitest'
describe('test:suite', async () => {
const util = await import("file:///test/test%20dir/util.mjs") // Error: [vite-node] Failed to load /test/test%20dir/util.mjs
console.log(util)
})System Info
System:
OS: macOS 12.5.1
Shell: 5.8.1 - /bin/zsh
Binaries:
Node: 18.7.0
npm: 8.15.0
Browsers:
Chrome: 104.0.5112.101
npmPackages:
vitest: ^0.22.1 => 0.22.1Used Package Manager
pnpm
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.
- 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.
Reactions are currently unavailable