-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
TypeError: wasm.__wbindgen_add_to_stack_pointer is not a function #480
Comments
cc @dqbd as this looks related to https://github.com/dqbd/tiktoken |
It seems like the issue is mostly contained when using Create React App. Will try to look into it to support CRA or at least improve the error message for DX. But if possible I would suggest using Vite instead, which is supported right now @waLLxAck . |
@waLLxAck Assuming you're (still) using Create React App for your app, you can also use
module.exports = {
webpack: {
configure: (config) => {
config.experiments = {
asyncWebAssembly: true,
layers: true,
};
// turn off static file serving of WASM files
// we need to let Webpack handle WASM import
config.module.rules
.find((i) => "oneOf" in i)
.oneOf.find((i) => i.type === "asset/resource")
.exclude.push(/\.wasm$/);
return config;
},
},
}; Updated notes can be found here : https://github.com/dqbd/tiktoken/tree/main/js#create-react-app |
And finally, there is an ongoing issue when attempting to use chatgpt in Deno via esm.sh, progress can be tracked here: |
@dqbd Hello! How can I config this in quasar.config.js? I have added these configurations to quasar.config.js, but the error still exists.
And this is my log.
|
This should be fixed in latest; we removed the wasm dependency #571 |
Verify latest release
chatgpt
releaseVerify webapp is working
Environment details
Node v19.8.1
Brave Version 1.49.120 Chromium: 111.0.5563.64 (Official Build) (64-bit)
Win 11
Describe the Bug
When importing the library I get this:
Uncaught (in promise) TypeError: wasm.__wbindgen_add_to_stack_pointer is not a function
at get_encoding (tiktoken_bg.js:174:1)
at ./node_modules/chatgpt/build/index.js (tokenizer.ts:4:1)
at options.factory (react refresh:6:1)
at webpack_require (bootstrap:24:1)
at fn (hot module replacement:62:1)
at ./src/pages/Pexels.js (src_pages_Pexels_js-node_modules_keyv_src_sync_recursive.chunk.js:18:65)
at options.factory (react refresh:6:1)
at webpack_require (bootstrap:24:1)
at fn (hot module replacement:62:1)
at |groupOptions: {}|namespace object:62:1
The text was updated successfully, but these errors were encountered: