Comments (8)
Thanks for reporting this, digging into this, it looks like Bun has a bug with process.send()
.
This is the minimal repro that works in Node.js, but fails in Bun:
process.on("message", (data) => {
console.log("Received:", data);
});
if (!process.env.CHILD) {
const child_process = require("child_process");
const subprocess = child_process.spawn(
process.argv0,
[__filename],
{
stdio: ["inherit", "inherit", "inherit", "ipc"],
env: {
...process.env,
CHILD: "1",
},
serialization: "json",
},
);
subprocess.on("spawn", () => {
const data = {
fn: () => {},
toJSON: () => "toJSON",
};
subprocess.send(data, (err) => {
console.log("Sent:", data, err);
});
});
}
from bun.
Face the same issue. Build with bun --bun run build
will never succeed. See the detail.
from bun.
I can confirm that this is still valid with Bun v1.0.29
.
from bun.
I can confirm this in docker
build. My Dockerfile
looks like
FROM oven/bun:alpine as builder
WORKDIR /app
COPY package.json bun.lockb ./
RUN bun install --frozen-lockfile
ENV NODE_ENV production
COPY ./ ./
RUN bun --bun run build
FROM oven/bun:alpine as production
WORKDIR /app
ENV NODE_ENV production
COPY --from=builder /app/package.json package.json
COPY --from=builder /app/bun.lockb bun.lockb
RUN bun install --production --frozen-lockfile
COPY --from=builder /app/.next .next
COPY --from=builder /app/public public
COPY --from=builder /app/next.config.mjs next.config.mjs
EXPOSE 3000
ENTRYPOINT ["bun"]
CMD ["--bun", "run", "start"]
The bun
version in oven/bun:alpine
is v1.0.29
.
But it works well on my Mac M1
with the same bun
version.
from bun.
Is still happen with Bun v1.0.30.
from bun.
Update to v1.0.33
but still stuck
from bun.
Doing NODE_ENV=production bun run build
also causes a similar issue if you do not have development tools installed on Fedora. The same behaviour is replicated the moment --bun
comes into play. When running without --bun
it looked like a dependency was missing/project dependencies weren't able to be built, causing it to hang - wonder if it could be a similar issue when involving --bun
?
from bun.
Also having this issue running bun --bun run next build
from bun.
Related Issues (20)
- Bun crashes when trying to install any package using ``bun install`` command. HOT 1
- pm2 does not work on cluster mode, any workaround? HOT 2
- bun build --compile crashes on windows
- Single-file executables icon on Windows HOT 2
- JSDom+Canvas segfaults on Windows
- Segmentation fault at address 0x118 after enabling SSL in Sequelize with Postgres
- /bin/sh: no closing quote
- Error UNABLE_TO_VERIFY_LEAF_SIGNATURE! HOT 1
- `bun create` not working
- `Bun test` crashing on windows
- `import.meta.main` is `false` when using `bun .` instead of `bun index.ts`
- websocket
- Workspaces -> Not being able to find workspace dependency
- https.Agent does not respect rejectUnauthorized option
- undefined symbol: node_module_register HOT 3
- Bun test crashes when collecting coverage
- segfault after closing webview window
- Update pnpm file
- Status Code and Size Response is not logged using Express Framework and Morgan Middleware
- crashed on running command bun install
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bun.