Skip to content

fix(add): the playground builds the page's remote before running - #1230

Merged
antoinetoussaint-byte merged 1 commit into
mainfrom
solution-assets-dir
Oct 29, 2026
Merged

antoinetoussaint-byte merged 1 commit into
mainfrom
solution-assets-dir

Conversation

@antoinetoussaint-byte

Copy link
Copy Markdown
Contributor

The last open defect from running a scaffolded solution end to end: the backend answered 404 for /assets/mf-manifest.json — the manifest it advertises in its own /.well-known/solution.json — so a host could federate nothing and the page had no bundle to load.

It was not the address

I expected this to be ASSETS_DIR and it is not. The solution runtime already defaults it to ../fe-remote/dist relative to the backend, which is correct. There was simply never a build there.

The fleet's playground runs scripts/build-frontend.sh first, which does exactly that build and then asserts the manifest exists. The scaffolded Makefile did not build the remote at all — so every scaffolded solution served an empty assets directory.

playground: remote
	cd playground && codefly run service $(PLAYGROUND_SERVICES) --env local

remote:
	cd services/fe-remote && npm install --no-audit --no-fund && npm run build
	test -f services/fe-remote/dist/mf-manifest.json

The test -f is deliberate: a missing bundle is now a build error at the top of the run rather than a 404 discovered much later. The shell installs the remote as a copy, so it needs it built too.

Verified on a clean scaffold

dist/mf-manifest.json                        1.7 kB
backend  /assets/mf-manifest.json            200   {"id":"notes","exposes":["Page"]}
edge     /                                   200   (signed in as alex)
edge     /v1/notes/overview                  200

Scope

One target in the scaffolded Makefile, its test, and the docs. Nothing else changes; ASSETS_DIR is untouched because it was never wrong.

Docs updated: docs/commands.md.

🤖 Generated with Claude Code

The backend answered 404 for /assets/mf-manifest.json — the manifest it
advertises in its own /.well-known/solution.json — so a host could
federate nothing and the page had no bundle to load.

The cause was not the address. The solution runtime serves /assets/ from
ASSETS_DIR, which already defaults to ../fe-remote/dist relative to the
backend; there was simply never a build there. The fleet's playground
runs its build-frontend.sh FIRST for exactly this reason, and the
scaffolded Makefile did not build the remote at all.

It now builds it and asserts the manifest exists before the run, so the
failure is a build error at the top rather than a 404 an hour later. The
shell installs the remote as a copy, so it needs it built too.

Verified on a clean scaffold:

    dist/mf-manifest.json                      1.7 kB
    backend /assets/mf-manifest.json           200
            {"id":"notes","exposes":["Page"]}
    edge    /                                  200  (signed in as alex)
    edge    /v1/notes/overview                 200

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@antoinetoussaint-byte
antoinetoussaint-byte added this pull request to the merge queue Oct 29, 2026
Merged via the queue into main with commit 2ce59a9 Oct 29, 2026
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant