Skip to content

[BUG] CompileError running client side #62

@rawsh

Description

@rawsh

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 createMuPdf on 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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions