Astro server crashes on startup with Bun 1.4.2 #167

Closed
opened 2026-10-05 01:45:33 +02:00 by adam · 2 comments
Owner

The Gitea Mirror service fails to start when running the generated Astro standalone server with Bun 1.4.2.

The service enters a restart loop with the following error:

TypeError: undefined is not an object (evaluating 'app.pipeline.getLogger')

The error originates from the generated Astro server bundle:

/opt/gitea-mirror/dist/server/entry.mjs:7141

Specifically:

if (process.env.ASTRO_NODE_LOGGING !== "disabled")
    app.pipeline.getLogger().then(() =>
        logListeningOn(app.adapterLogger, server.server, host)
    );

Environment

  • OS: Debian
  • Runtime: Bun 1.4.2
  • Application: Gitea Mirror
  • Deployment: systemd
  • Gitea Mirror: 3.35.1

Error

TypeError: undefined is not an object (evaluating 'app.pipeline.getLogger')
    at standalone (/opt/gitea-mirror/dist/server/entry.mjs:7141:57)
    at /opt/gitea-mirror/dist/server/entry.mjs:7194:54
Bun v1.4.2 (Linux x64)

Workaround

Setting the following environment variable prevents the failing logging initialization:

ASTRO_NODE_LOGGING=disabled

After applying the override and restarting the service, the application starts normally.

Expected behavior

The standalone Astro server should initialize successfully without requiring ASTRO_NODE_LOGGING=disabled.

Additional information

The failure appears to occur during Astro's standalone server startup and specifically when accessing app.pipeline.getLogger(). Disabling Astro node logging bypasses the problematic code path.

This may be related to the Astro adapter/build output or Bun 1.4.2 compatibility.

The Gitea Mirror service fails to start when running the generated Astro standalone server with **Bun 1.4.2**. The service enters a restart loop with the following error: ```text TypeError: undefined is not an object (evaluating 'app.pipeline.getLogger') ``` The error originates from the generated Astro server bundle: ```text /opt/gitea-mirror/dist/server/entry.mjs:7141 ``` Specifically: ```js if (process.env.ASTRO_NODE_LOGGING !== "disabled") app.pipeline.getLogger().then(() => logListeningOn(app.adapterLogger, server.server, host) ); ``` ### Environment * OS: Debian * Runtime: Bun 1.4.2 * Application: Gitea Mirror * Deployment: systemd * Gitea Mirror: 3.35.1 ### Error ```text TypeError: undefined is not an object (evaluating 'app.pipeline.getLogger') at standalone (/opt/gitea-mirror/dist/server/entry.mjs:7141:57) at /opt/gitea-mirror/dist/server/entry.mjs:7194:54 Bun v1.4.2 (Linux x64) ``` ### Workaround Setting the following environment variable prevents the failing logging initialization: ```text ASTRO_NODE_LOGGING=disabled ``` After applying the override and restarting the service, the application starts normally. ### Expected behavior The standalone Astro server should initialize successfully without requiring `ASTRO_NODE_LOGGING=disabled`. ### Additional information The failure appears to occur during Astro's standalone server startup and specifically when accessing `app.pipeline.getLogger()`. Disabling Astro node logging bypasses the problematic code path. This may be related to the Astro adapter/build output or Bun 1.4.2 compatibility. <!-- github-sync-id:5411877060 -->
adam closed this issue 2026-10-05 01:45:33 +02:00
Author
Owner

Thanks for the report and the workaround. This is a regression in 3.35.1 and Bun 1.4.2 is not the cause: the same crash happens on Bun 1.3.6.

The 3.35.1 security update raised astro to 7.3, which moved the startup logger from app.pipeline.getLogger() to app.getLogger(). The node adapter stayed at 11.0.2, which still reads app.pipeline, so starting dist/server/entry.mjs directly crashes. Docker was not affected because the image starts the app through scripts/runtime-server.ts, which disables the adapter's autostart, so nobody in CI saw it. Your systemd unit and the Nix package run entry.mjs directly and hit it.

v3.36.0 updates the adapter to 11.1.5 (#421). With it, entry.mjs starts under Bun 1.3.6 and 1.4.2 without ASTRO_NODE_LOGGING=disabled, and you can drop that override after updating.

Thanks for the report and the workaround. This is a regression in 3.35.1 and Bun 1.4.2 is not the cause: the same crash happens on Bun 1.3.6. The 3.35.1 security update raised astro to 7.3, which moved the startup logger from `app.pipeline.getLogger()` to `app.getLogger()`. The node adapter stayed at 11.0.2, which still reads `app.pipeline`, so starting `dist/server/entry.mjs` directly crashes. Docker was not affected because the image starts the app through `scripts/runtime-server.ts`, which disables the adapter's autostart, so nobody in CI saw it. Your systemd unit and the Nix package run `entry.mjs` directly and hit it. v3.36.0 updates the adapter to 11.1.5 (#421). With it, `entry.mjs` starts under Bun 1.3.6 and 1.4.2 without `ASTRO_NODE_LOGGING=disabled`, and you can drop that override after updating. <!-- github-comment-id:5623202056 -->
Author
Owner

thanks, appreciate the quick fix!

thanks, appreciate the quick fix! <!-- github-comment-id:5623646697 -->
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/gitea-mirror#167