Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wasm RuntimeError: memory access out of bounds #131

Open
nimbit-software opened this issue Dec 13, 2024 · 0 comments
Open

Wasm RuntimeError: memory access out of bounds #131

nimbit-software opened this issue Dec 13, 2024 · 0 comments

Comments

@nimbit-software
Copy link
Contributor

nimbit-software commented Dec 13, 2024

Im getting an error when using wasm with nextjs it im not sure if its a nextjs error or a wasm/rust error?

this is how im loading the wasm.

import * as zenWasm from '@gorules/zen-engine-wasm';
import zenWasmUrl from '@gorules/zen-engine-wasm/dist/zen_engine_wasm_bg.wasm?url';

// in component 
 useEffect(() => {
    const initWasm = async () => {
      await zenWasm.default(zenWasmUrl);
      setIsWasmLoaded(true);
    };

    initWasm().catch(console.error);
  }, []);

and this is the next.config.js

 config.experiments = { ...config.experiments, asyncWebAssembly: true, syncWebAssembly: true, layers: true };
    config.resolve.extensions.push('.wasm');

    config.module.rules.push({
      test: /\.wasm$/,
      type: 'asset/resource',
    });
zen_engine_wasm_bg.beb22cf8.wasm:0x71c7d Uncaught RuntimeError: memory access out of bounds
    at zen_engine_wasm_bg.beb22cf8.wasm:0x71c7d
    at zen_engine_wasm_bg.beb22cf8.wasm:0x70e9f
    at VariableTypeFinalization (zen_engine_wasm.js:254:44)

Uncaught RuntimeError: unreachable
    at zen_engine_wasm_bg.beb22cf8.wasm:0x6f1fc
    at zen_engine_wasm_bg.beb22cf8.wasm:0x70e66
    at zen_engine_wasm_bg.beb22cf8.wasm:0x71806
    at zen_engine_wasm_bg.beb22cf8.wasm:0x6fb35
    at zen_engine_wasm_bg.beb22cf8.wasm:0x71cad
    at zen_engine_wasm_bg.beb22cf8.wasm:0x70e9f
    at VariableTypeFinalization (zen_engine_wasm.js:254:44)
    at FinalizationRegistry.cleanupSome (<anonymous>)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant