-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Closed as duplicate of#15298
Labels
p3-minor-bugAn edge case that only affects very specific usage (priority)An edge case that only affects very specific usage (priority)
Description
Describe the bug
Related issue: nitrojs/nitro#448 and vitest-dev/vitest#1937
When importing a module path with spaces, vite-node will throw Error: [vite-node] Failed to load, but it works fine in node env.
This works in 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)
})Reproduction
https://github.com/clarkdo/vest-import-with-spaces-issue
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
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.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
p3-minor-bugAn edge case that only affects very specific usage (priority)An edge case that only affects very specific usage (priority)