Skip to content

Enable .mjs static file fallback in all environments#84

Merged
antosubash merged 4 commits intomainfrom
claude/fix-docker-auth-1x4E4
Apr 5, 2026
Merged

Enable .mjs static file fallback in all environments#84
antosubash merged 4 commits intomainfrom
claude/fix-docker-auth-1x4E4

Conversation

@antosubash
Copy link
Copy Markdown
Owner

Summary

  • The UseStaticFiles fallback for .mjs chunks was gated behind IsDevelopment(), causing 404s for Users module page chunks in the deployed Docker app while other modules worked fine
  • MapStaticAssets() builds a manifest at publish time, but when the deployed image has a stale manifest (Docker layer caching, etc.), .mjs chunks not in the manifest get 404s with no fallback in production
  • Removing the environment gate ensures .mjs files in wwwroot are always served, even if MapStaticAssets doesn't know about them

Root cause

Clicking "Log in" on the deployed site at app.simplemodule.dev did nothing because:

  1. The pages.js entry loaded fine (it's in the static assets manifest)
  2. The lazy-loaded .mjs chunk (Login-CyRO3Y-E.mjs) returned 404
  3. The Inertia page resolve silently failed, leaving a blank page

Test plan

  • Deploy and verify /Identity/Account/Login page renders correctly
  • Verify all module .mjs chunks load (not just pages.js entries)
  • Verify no regression in development mode static file serving

claude added 2 commits April 5, 2026 13:03
ASP.NET Identity defaults the login redirect to /Account/Login, but
the Users module's ViewPrefix is /Identity/Account, placing the actual
login route at /Identity/Account/Login. This mismatch caused
unauthenticated requests to redirect to a 404 page.

Explicitly sets LoginPath, LogoutPath, and AccessDeniedPath on the
application cookie to match the module's ViewPrefix.
The UseStaticFiles fallback for .mjs chunks was gated behind
IsDevelopment(), but MapStaticAssets can miss .mjs files when the
Docker image's static asset manifest is stale. This caused 404s for
Users module page chunks in production while other modules worked.

Removing the environment gate ensures .mjs files in wwwroot are always
served even if MapStaticAssets doesn't know about them.
@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented Apr 5, 2026

Deploying simplemodule-website with  Cloudflare Pages  Cloudflare Pages

Latest commit: ae95ad0
Status: ✅  Deploy successful!
Preview URL: https://8502fa4f.simplemodule-website.pages.dev
Branch Preview URL: https://claude-fix-docker-auth-1x4e4.simplemodule-website.pages.dev

View logs

antosubash and others added 2 commits April 5, 2026 16:36
When a module's page chunk fails to load (404, network error, missing
page registry entry), the user previously saw nothing — the page just
stayed blank. Now shows a toast: "Failed to load page X. Try refreshing
the page."
@antosubash antosubash merged commit 60f0bc2 into main Apr 5, 2026
4 checks passed
@antosubash antosubash deleted the claude/fix-docker-auth-1x4E4 branch April 5, 2026 15:00
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