Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bun in Docker for M1 Mac intermittently fails with message "Module not found" #11127

Open
Gikkman opened this issue May 16, 2024 · 0 comments
Open
Labels
bug Something isn't working

Comments

@Gikkman
Copy link

Gikkman commented May 16, 2024

What version of Bun is running?

1.1.8

What platform is your computer?

Darwin 23.4.0 arm64 arm

What steps can reproduce the bug?

Create an empty directory, and add a single js file:

console.log("Hello via Bun!");

Now run the file via Docker:

docker run --rm -v "$PWD":/app --workdir=/app oven/bun:1.1.8 index.js

The first time it succeeds, but if I re-run it immediately, I get the response:

error: Module not found "/app/index.js"

Bun v1.1.8 (Linux arm64)

So I figured that it might be a problem with the volume, so I tried to forward a shell and execute bun several times:

docker run --rm -v "$PWD":/app --workdir=/app --entrypoint=sh oven/bun:1.1.8 -c 'bun index.js; bun index.js; bun index.js;'

Hello via Bun!
error: Module not found "/app/index.js"

Bun v1.1.8 (Linux arm64)
error: Module not found "/app/index.js"

Bun v1.1.8 (Linux arm64)

Interestingly, I don't get the same with plain node:

docker run --rm -v "$PWD":/app --workdir=/app --entrypoint=sh node:20 -c 'node index.js; node index.js; node index.js;'

Hello via Bun!
Hello via Bun!
Hello via Bun!

What is the expected behavior?

No response

What do you see instead?

No response

Additional information

I've tried it with several versions of bun, all the way down to 1.0.0 and I see the same result.

Here's my docker version, that might matter. It's a Rancher Desktop installation.

$ docker version                                                                                                                        
Client:
 Version:           25.0.4-rd
 API version:       1.43 (downgraded from 1.44)
 Go version:        go1.21.8
 Git commit:        c4cd0a9
 Built:             Fri Mar  8 09:09:46 2024
 OS/Arch:           darwin/arm64
 Context:           default

Server:
 Engine:
  Version:          24.0.7
  API version:      1.43 (minimum version 1.12)
  Go version:       go1.21.3
  Git commit:       311b9ff0aa93aa55880e1e5f8871c4fb69583426
  Built:            Fri Oct 27 15:13:04 2023
  OS/Arch:          linux/arm64
  Experimental:     false
 containerd:
  Version:          v1.7.10
  GitCommit:        4e1fe7492b9df85914c389d1f15a3ceedbb280ac
 runc:
  Version:          1.1.10
  GitCommit:        18a0cb0f32bcac2ecc9a10f327d282759c144dab
 docker-init:
  Version:          0.19.0
  GitCommit:
@Gikkman Gikkman added the bug Something isn't working label May 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant