jieba-wasm icon indicating copy to clipboard operation
jieba-wasm copied to clipboard

Cannot read properties of undefined (reading '__wbindgen_add_to_stack_pointer')

Open mimoo opened this issue 2 years ago • 3 comments

I get this error when trying to use the project within a vuejs project. Do you know what could cause this?

Screenshot 2023-06-17 at 9 18 55 PM

mimoo avatar Jun 18 '23 04:06 mimoo

same problem

TerryYoung518 avatar Oct 12 '23 17:10 TerryYoung518

same problem

seabree-12 avatar Jan 04 '24 06:01 seabree-12

Use this to init before calling functions.

For example in react.

import init, { cut } from "jieba-wasm/pkg/web/jieba_rs_wasm.js";


export default function TestJieba(): JSX.Element {

    useEffect(() => {
        init("https://cdn.jsdelivr.net/npm/jieba-wasm@latest/pkg/web/jieba_rs_wasm_bg.wasm");
    }, []);

    function cutTest(text) {
        const cutWords = cut(text);
        console.log(cutWords);
    }
}

krmanik avatar Feb 11 '24 03:02 krmanik

We should call init method to load the wasm file before to call other method in browser.

I have created a pull request https://github.com/fengkx/jieba-wasm/pull/4 to show usage in browser.

Thulof avatar May 17 '24 17:05 Thulof

Fixes By #4

fengkx avatar May 19 '24 13:05 fengkx