Skip to content

How to make it work? #3

@bobWinner

Description

@bobWinner

I don't know much about these .wasm files.

In browser javascript, whenever I import the way of the readme

import init, { PathfindingWasm } from "./pkg/pathfinding3d.js";

await init();

it sends me this error :

Failed to load module script: Expected a JavaScript-or-Wasm module script but the server responded with a MIME type of "application/wasm". Strict MIME type checking is enforced for module scripts per HTML spec.

On the internet, people says .wasm should be imported/instanciated this way :

const wasm = await WebAssembly.instantiateStreaming(
	fetch("./pathfinding3d_bg.wasm")
);

Can someone explain how to make this library work ?

i'd like to use it in both vanilla-js and webpack (production & dev-server)

thank you.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions