Skip to content

fix: wrong content length#98

Merged
scolastico merged 3 commits intomainfrom
fix/wrong-content-length-from-nitro
Feb 1, 2026
Merged

fix: wrong content length#98
scolastico merged 3 commits intomainfrom
fix/wrong-content-length-from-nitro

Conversation

@scolastico
Copy link
Member

Description

This PR refactors the UI container architecture to resolve a critical bug where config.json was being truncated in production environments.

The issue occurred because the previous Nitro-based server cached the Content-Length of the static config.json file during the build process. When the entrypoint script attempted to overwrite this file at runtime with environment variables, the server continued to serve only the original number of bytes, resulting in truncated/invalid JSON and the "API is not compatible" error.

Key Changes:

  • Static Generation: Switched from nuxt build to nuxt generate to create a pure static export of the UI.
  • Express Entrypoint: Introduced a dedicated Express server in the entrypoint/ directory. This server dynamically generates the config.json response, ensuring the Content-Length matches the runtime environment variables.
  • Production Serving: The Express server serves the static assets from /app/public and handles SPA routing fallbacks to index.html.
  • Dockerfile Refactor: Updated the Dockerfile to support the new build and execution flow, including pnpm support for the entrypoint dependencies.

Related Issue

Closes not-three/main#27

Checklist

  • I have tested my changes locally
  • I have updated the documentation if needed
  • This PR follows the project's coding style

Additional Notes

  • The entrypoint now resides in entrypoint/ with its own package.json and pnpm-lock.yaml for better isolation.
  • The container path /app/public is used to host the static assets, maintaining consistency with existing documentation.

@github-actions github-actions bot added docker Pull requests that update Docker code public labels Feb 1, 2026
@github-actions
Copy link

github-actions bot commented Feb 1, 2026

PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-02-01 11:46 UTC

@scolastico scolastico merged commit c21fec5 into main Feb 1, 2026
2 checks passed
@scolastico scolastico deleted the fix/wrong-content-length-from-nitro branch February 1, 2026 11:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docker Pull requests that update Docker code public

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: API is not compatible with this version of the client

1 participant