Skip to content

fix: load runtime config before app bundle - #85

Merged
kalinon merged 1 commit into
ByMosDev:mainfrom
truiem-bot:fix/runtime-config-load-order
Apr 15, 2026
Merged

fix: load runtime config before app bundle#85
kalinon merged 1 commit into
ByMosDev:mainfrom
truiem-bot:fix/runtime-config-load-order

Conversation

@truiem-bot

Copy link
Copy Markdown

This ensures config.js loads before the app bundle in production.

Why this matters:

  • the dashboard relies on window.__RUNTIME_CONFIG__, which is generated by docker-entrypoint.sh at container start
  • a clean Vite production build from current main emits the module bundle in <head> but leaves config.js in <body>
  • that means the app bundle can run before config.js, causing runtime config to be unavailable at bootstrap time
  • when that happens, the app can fall back to build-time/default values instead of the container-provided runtime config

What changed:

  • move <script src="/config.js"></script> into <head> ahead of the app module script in web/index.html

Verification:

  • built a clean temp copy of current main
  • observed output order before fix:
    • <script type="module" ...> in <head>
    • <script src="/config.js"></script> in <body>
  • built locally with this change and confirmed the emitted output loads config.js before the module bundle

@kalinon
kalinon merged commit 7642b58 into ByMosDev:main Apr 15, 2026
9 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.

2 participants