Git Product home page Git Product logo

Comments (8)

Electroid avatar Electroid commented on July 20, 2024 3

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.

jiushiwoyuze avatar jiushiwoyuze commented on July 20, 2024 1

Face the same issue. Build with bun --bun run build will never succeed. See the detail.
image

from bun.

cemo avatar cemo commented on July 20, 2024

I can confirm that this is still valid with Bun v1.0.29.

from bun.

erguotou520 avatar erguotou520 commented on July 20, 2024

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.

hiroyamaguch avatar hiroyamaguch commented on July 20, 2024

Is still happen with Bun v1.0.30.

from bun.

erguotou520 avatar erguotou520 commented on July 20, 2024

image

Update to v1.0.33 but still stuck

from bun.

cyrus01337 avatar cyrus01337 commented on July 20, 2024

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.

kaumac avatar kaumac commented on July 20, 2024

Also having this issue running bun --bun run next build

from bun.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.