I have the following snippet from my Vite/Zustand react project.
import { create } from 'zustand'
import {AsBind} from 'as-bind';
const useStatsStore = create((set, get) => ({
statsWasm: null,
loadedStatsWasm: false,
loadStatsWasm: async () => {
const wasm = await fetch('my-wasm.wasm');
console.log('statsWasm', wasm);
const instance = await AsBind.instantiate(wasm, {});
set({statsWasm: instance});
},
runStats: () => {
const wasm = get().statsWasm;
console.log(wasm.exports.myExportedFunctionThatTakesAString('asfdasfdasf'));
}
}))
export default useStatsStore;
But when I load the project, I get this error in the javascript console, and the page fails to load
Uncaught SyntaxError: ambiguous indirect export: AsBind
The syntax error is listed as that 2nd line where I import AsBind
.
I've tried import AsBind from 'as-bind'
and import * as AsBind from "as-bind"
as well, and neither work.
Why am I getting this error simply trying to import it?