sqrtsanta
Repos
3
Followers
12
Following
9

Events

started
Created at 1 week ago
Created at 3 weeks ago
started
Created at 3 weeks ago
started
Created at 3 weeks ago
Created at 3 weeks ago
started
Created at 3 weeks ago
opened issue
TypeError: Unknown file extension ".wasm"

Describe the bug

Vitest fails with an error TypeError: Uknown file extension ".wasm" if I use url-import with external packages:

import wasmSrc from 'jsmpeg-lite/jsmpeg.wasm?url';

export function builder() {
  return {
    id: 'aaaa-bbbb-cccc-dddd',
    wasmSrc,
  };
}

Meanwhile Vite works perfectly generating url for that wasm file. You can run npm run dev in provided StackBlitz link and check console with correct url.

Reproduction

https://stackblitz.com/edit/vitest-dev-vitest-eagna5

System Info

System:
    OS: Linux 5.18 Fedora Linux 36 (Workstation Edition)
    CPU: (8) x64 Intel(R) Core(TM) i7-9700 CPU @ 3.00GHz
    Memory: 18.80 GB / 31.10 GB
    Container: Yes
    Shell: 5.2.2 - /bin/bash
Binaries:
    Node: 16.14.2 - ~/.nvm/versions/node/v16.14.2/bin/node
Browsers:
    Chrome: 103.0.5060.114
    Firefox: 105.0.2
npmPackages:
    @vitejs/plugin-react: ^2.1.0 => 2.1.0
    vite: ^3.1.7 => 3.1.8
    vitest: ^0.24.1 => 0.24.1

Used Package Manager

pnpm

Validations

Created at 1 month ago
Created at 1 month ago
started
Created at 1 month ago
Created at 2 months ago