react / react/yoga

weird error when running test with jest

Open
#1,777 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
18.9k
Forks
1.6k
Avg merge
1m
Merged PRs (30d)
1

Description

Report

Issues and Steps to Reproduce

failed to asynchronously prepare wasm: CompileError: WebAssembly.instantiate(): BufferSource argument is empty

      at v (../../node_modules/yoga-layout/dist/binaries/yoga-wasm-base64-esm.js:63:371)

  console.warn
    Aborted(CompileError: WebAssembly.instantiate(): BufferSource argument is empty)

      at v (../../node_modules/yoga-layout/dist/binaries/yoga-wasm-base64-esm.js:13:60)
      at x (../../node_modules/yoga-layout/dist/binaries/yoga-wasm-base64-esm.js:63:418)

When running a test in our backend, it is getting this error on yoga-layout

├─┬ @react-pdf/renderer 4.1.6
                                                                            │ └─┬ @react-pdf/layout 4.2.0
                                                                            │   └── yoga-layout 3.2.1
                                                                            

Expected Behavior

it should not error

Actual Behavior

it is breaking

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the Jest failure with the yoga-layout 3.2.1 dependency shown through @react-pdf/renderer, then inspect the referenced yoga-wasm-base64-esm.js path and the test setup. Done means the WebAssembly module no longer receives an empty buffer and the backend test runs without the reported error.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, wasm
Domain
testing-qa
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.