Skip to content

fix(build): build-local fails on a fresh clone without an Atmosphere build #2654

Open

Description

@coygeek

Summary

The documented local build command fails on a fresh clone after installing dependencies and copying the example configuration files. build-local starts esbuild before the workspace package's exported JavaScript exists. Building Atmosphere first makes the same command succeed.

Runtime or environment

Reproduced on Linux with Node.js v26.12.1 and npm 12.2.1, using a fresh clone of current main at commit 4aae23e3162b9ae16b74522c9df055e16b1fecef. No GitHub releases or tags are published; the live worker's release header also identifies this revision. Dependencies were installed with npm install; no real credentials were supplied.

Steps to reproduce

Start from a fresh clone at the tested revision, before running tests or any other build:

git clone https://github.com/FxEmbed/FxEmbed.git
cd FxEmbed
npm install
cp wrangler.example.toml wrangler.toml
cp .env.example .env
npm run build-local

For the control, leave the configuration unchanged and run:

npm run build:atmosphere
npm run build-local

Expected behavior

The documented local build sequence should produce dist/worker.js without deploying. If an earlier Atmosphere build is a required prerequisite, the local build instructions should explicitly include that step.

Actual behavior

The first npm run build-local exits 1 with unresolved workspace exports. This is an excerpt from the observed output:

✘ [ERROR] Could not resolve "@fxembed/atmosphere/providers/bluesky-runtime"

    src/worker.ts:13:7:
      13 │ } from '@fxembed/atmosphere/providers/bluesky-runtime';
         ╵        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  The module "./dist/providers/bluesky-runtime.js" was not found on the file system:

    node_modules/@fxembed/atmosphere/package.json:39:16:
      39 │       "import": "./dist/providers/bluesky-runtime.js"
         ╵                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The output also reports missing Instagram, Mastodon, Twitter, and TikTok exports. packages/atmosphere/dist/ is absent after installation. The control's Atmosphere build exits 0; the following local build exits 0 and writes a 1,563,322-byte worker bundle.

Evidence

  • Expected source: AGENTS.md, Key commands lists the local build before tests; the published Building Locally instructions present npm run build-local without an Atmosphere prerequisite.
  • Failure source: The fresh-clone command sequence and esbuild output above, with a successful control using the same install and configuration.
  • Evidence provenance: observed
  • Local verification: reproduced
  • Reproduction completeness: complete

In package.json, build runs build:atmosphere first and pretest does the same, while build-local directly invokes node esbuild.config.mjs --no-sentry-upload. The workspace's exports point to generated files under dist/.

The issue does not imply the same missing build step in the other entry points: wrangler.example.toml selects npm run build, and the Dockerfile explicitly runs npm run build:atmosphere && npm run build-local. These entry-point comparisons are from source inspection; a Wrangler server and a Docker image build were not run.

Restoration check

From a fresh clone without packages/atmosphere/dist/, follow the complete documented local build sequence and verify that it exits 0 and creates a worker bundle. Preserve the local command's behavior of skipping Sentry uploads. An existing Atmosphere build should not be necessary unless that prerequisite appears explicitly in the instructions.

Additional context

Either making build-local build Atmosphere first or documenting the required command order would address the mismatch. The successful control demonstrates an available workaround without changing source or supplying credentials.

Triage assessment

  • Impact level: P2
  • Assessment status: supported
  • Impact basis: The documented local build fails for a fresh installation, blocking that build until an extra workspace build is performed; no production outage or data loss was observed.
  • Workaround status: available
  • Workaround basis: Running npm run build:atmosphere before the same local build succeeded with unchanged configuration and produced the worker bundle.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions