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

ERROR: No loader is configured for ".wasm" files: #1133

Closed
yhmjSky opened this issue May 5, 2023 · 4 comments
Closed

ERROR: No loader is configured for ".wasm" files: #1133

yhmjSky opened this issue May 5, 2023 · 4 comments

Comments

@yhmjSky
Copy link

yhmjSky commented May 5, 2023

When I use @sveltejs/adapter-cloudflare, as long as I import openai (or other llm) in my project, I get the following error. How can I solve it?

error during build:
Error: Build failed with 1 error:
node_modules/.pnpm/@dqbd+tiktoken@1.0.1/node_modules/@dqbd/tiktoken/tiktoken.js:1:22: ERROR: No loader is configured for ".wasm" files: node_modules/.pnpm/@dqbd+tiktoken@1.0.1/node_modules/@dqbd/tiktoken/tiktoken_bg.wasm

@yhmjSky yhmjSky closed this as not planned Won't fix, can't repro, duplicate, stale May 15, 2023
@dqbd
Copy link
Collaborator

dqbd commented May 15, 2023

This will be addressed with #1239

@iwasrobbed
Copy link

🙏 Hit this randomly today in a Next.js project on TypeScript and no idea what the cause is:

error - ./node_modules/@dqbd/tiktoken/tiktoken_bg.wasm
Module parse failed: Unexpected character '' (1:0)
The module seem to be a WebAssembly module, but module is not flagged as WebAssembly module for webpack.
BREAKING CHANGE: Since webpack 5 WebAssembly is not enabled by default and flagged as experimental feature.
You need to enable one of the WebAssembly experiments via 'experiments.asyncWebAssembly: true' (based on async modules) or 'experiments.syncWebAssembly: true' (like webpack 4, deprecated).
For files that transpile to WebAssembly, make sure to set the module type in the 'module.rules' section of the config (e. g. 'type: "webassembly/async"').
(Source code omitted for this binary file)

Hoping the new tiktoken rewrite will remove the issue @dqbd

@yhmjSky
Copy link
Author

yhmjSky commented May 17, 2023

这将通过#1239解决

it’s great. This bug may be caused by @sveltejs/adapter-cloudflare. Loading wasm locally is no problem., but if wasm is loaded in the imported module, will throw this error.

@iwasrobbed
Copy link

Note: this seems to be fixed & merged (to be released later today possible)

#62 (comment)

#62 (comment)

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

3 participants