-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
p2-to-be-discussedEnhancement under consideration (priority)Enhancement under consideration (priority)
Description
Describe the bug
I'm importing a wasm module in a .ts file like so:
import init from '$lib/fileName.wasm?init';
Importing the wasm file follows the recommended way in the vite documentation:
https://vite.dev/guide/features.html#webassembly
The wasm module was compiled with emcc:
emcc -s EXPORTED_FUNCTIONS='["_function"]' --no-entry -std=c++20 -O1 src_cpp/file.cpp -o src/lib/fileName.wasm
I'm then importing a function that initializes the wasm module in a test file:
import {
func
} from '$lib/file2';
import { describe, it, expect } from 'vitest';`
Running the test with:
pnpm run test
I get the error:
TypeError: Failed to parse URL from /src/lib/fileName.wasm?init
Caused by: TypeError: Invalid URL
Serialized Error: { code: 'ERR_INVALID_URL', input: '/src/lib/fileName.wasm?init' }
Reproduction
Can't reproduce wasm on StackBlitz as far as I know.
System Info
ConfidentialUsed 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
Metadata
Metadata
Assignees
Labels
p2-to-be-discussedEnhancement under consideration (priority)Enhancement under consideration (priority)
Type
Projects
Status
P2 - 4