Skip to content

fix: serve built editor assets from dist/ directory#55

Open
jessems wants to merge 1 commit into
EveryInc:mainfrom
jessems:fix/serve-dist-assets
Open

fix: serve built editor assets from dist/ directory#55
jessems wants to merge 1 commit into
EveryInc:mainfrom
jessems:fix/serve-dist-assets

Conversation

@jessems

@jessems jessems commented Jun 9, 2026

Copy link
Copy Markdown

Summary

  • The server reads dist/index.html and injects meta tags to serve the editor for /d/:slug routes, but dist/ was never registered as a static path.
  • This caused the browser to receive 404s for editor.js and all other built assets, leaving the page stuck on "Loading editor..." after npm run build.

Fix

Add a single express.static middleware for the dist/ directory, directly after the existing public/ one.

Reproduction

npm install
npm run build
npm run serve
# open http://localhost:4000/d/<slug> → stuck on "Loading editor..."

Test plan

  • npm run build && npm run serve
  • Create a document via POST /documents
  • Open the returned URL — editor loads and connects

The server reads dist/index.html to inject meta tags and serve it for
/d/:slug routes, but never registered dist/ as a static path. This caused
the browser to receive 404s for editor.js and all other built assets,
leaving the page stuck on "Loading editor...".

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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