Support running `@antv/layout-wasm` on Node.js
Open
layout-wasm
- Dominant language
- TypeScript
- Stars
- 276
- Forks
- 60
- PR merge metrics
- No merged PRs in 30d
Description
Currently trying to run `import * as layoutWasm from '@antv/layout-wasm'` produces an error `ReferenceError: self is not defined` since the `index.min.js` contains references to `self` and expects to be run in a browser environment.
Version: `@antv/layout-wasm` 1.4.2
Contributor guide
Research direction
Start with the generated index.min.js shipped by @antv/layout-wasm and reproduce the import under Node.js using the issue's example. Trace the self reference and verify that importing the package on Node.js completes without the ReferenceError, while preserving browser use.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- nodejs, typescript, wasm
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100