Skip to content

bun build --compile fails if dependency uses wasm #6567

@roninjin10

Description

@roninjin10

What version of Bun is running?

1.0.6+969da088f5db3258a803ec186012e30f992829b4

What platform is your computer?

macos Darwin 22.6.0 arm64 arm

What steps can reproduce the bug?

Install a node module like ink that has wasm in it

bun install ink

Add it to an index.ts

console.log(await import('ink'))

It will fail

What is the expected behavior?

Should work

What do you see instead?

➜ minimal-bun-repro bun start
$ bun build ./index.ts --compile --outfile mycli && ./mycli
[29ms] bundle 112 modules
[88ms] compile mycli

error: Cannot find module "./yoga.wasm" from "compi

Additional information

Minimal repro here git@github.com:roninjin10/minimal-bun-repro.git

git clone git@github.com:roninjin10/minimal-bun-repro.git
cd minimal-bun-repro
bun install
bun start

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingbundlerSomething to do with the bundlerconfirmed bugWe can reproduce this issue

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions