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

Incompatibility with vitest 0.25.6 #90

Closed
harveylee opened this issue Dec 19, 2022 · 1 comment
Closed

Incompatibility with vitest 0.25.6 #90

harveylee opened this issue Dec 19, 2022 · 1 comment
Labels
wontfix This will not be worked on

Comments

@harveylee
Copy link

harveylee commented Dec 19, 2022

I have a piece of code in a vitest test like:

import { something } from '~/fileA'
// ...and later
const module = await import('~/foo/bar/fileB')

And in my tsconfig.json, something like:

{
  "compilerOptions": {
    "baseUrl": "./src",
    "paths": {
      "~/*": ["./*"]
    }
  }
}

(i.e. I create an alias ~ for the src directory)

Using vitest 0.25.5, both the static import (fileA) and the dynamic import (fileB) work.

Using vitest 0.25.6, the static import works but the dynamic import fails.
[vite-node] Failed to load ~/foo/bar/fileB

Here is the commit in vitest 0.25.6 that I think gives rise to this issue?
vitest-dev/vitest#2461
vitest-dev/vitest@e9cb4136

@aleclarson
Copy link
Owner

This seems like a Vitest bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants