[BUG] CompileError running client side
Describe the bug When instantiating the library on a NextJS client component I'm getting web assembly errors.
To Reproduce Steps to reproduce the behavior:
- Call
createMuPdfon a nextjs client component
Log output Initially fails trying to import FS. If you mock out FS with the following web pack config
webpack(config, { webpack, isServer }) {
if (!isServer) {
config.resolve.fallback = {
fs: false
}
}
return config;
},
Then the import works, but you get the following when instantiating mupdf.
RuntimeError: abort(CompileError: WebAssembly.Module doesn't parse at byte 0: module doesn't start with '\0asm'). Build with -s ASSERTIONS=1 for more info.
hi @rawsh , were you able to fix it?
@siduck I ended up giving up and parsing docs on the server side
@siduck I ended up giving up and parsing docs on the server side
ive tried mupdf-js with vite, works like a charm man
Yep I think it's a nextJS issue
Are there any news on this?
@tgdn no, i stopped using this