Skip to content

TeemuKoivisto/vite-unable-to-alias-module

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

vitest/vite unable to alias module

vitest-dev/vitest#1638

I am replacing my old Jest tests with Vitest but I am unable to resolve modules using aliases, similar to my old setup.

How to reproduce

  1. pnpm i
  2. pnpm test
  3. Should produce an error similar to:
FAIL  test/failing.test.ts > test which loads the same module with different versions > should alias them as defined in vite.config.js
RangeError: Can not convert <> to a Fragment (looks like multiple versions of prosemirror-model were loaded)
 ❯ Function.from node_modules/.pnpm/[email protected]/node_modules/prosemirror-model/dist/index.js:332:9
 ❯ NodeType.create node_modules/.pnpm/[email protected]/node_modules/prosemirror-model/dist/index.js:1974:60

Running the same test with jest pnpm jest passes:

 PASS  test/failing.test.ts
  test which loads the same module with different versions
    ✓ should alias them as defined in vite.config.js (58 ms)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published