Skip to content

fix: resolve SPA fallback issues (HTML shadowing and MIME type errors)#2198

Open
barissalihbabacan wants to merge 4 commits into
anyproto:developfrom
barissalihbabacan:feat/web-dev-spa-fallback
Open

fix: resolve SPA fallback issues (HTML shadowing and MIME type errors)#2198
barissalihbabacan wants to merge 4 commits into
anyproto:developfrom
barissalihbabacan:feat/web-dev-spa-fallback

Conversation

@barissalihbabacan

Copy link
Copy Markdown
Contributor

  • I understand that contributing to this repository will require me to agree with the CLA

Description

This PR fixes the SPA dev-server issues that caused the revert of #2173.

Key changes:

  1. Fixes HTML shadowing: Skips dist/ lookup for / and /index.html in dev mode to ensure src/html/index.html is loaded correctly instead of stale production builds.
  2. Resolves MIME type errors: Restricts the SPA fallback to only navigation requests (HTML/no extension). This ensures that missing assets (.js, .css, .png, etc.) correctly return a 404 instead of an HTML body.
  3. Dispatcher Improvements: Refactored startStream to be Promise-based for more reliable connection lifecycle management and added error handling for session creation failures.

What type of PR is this? (check all applicable)

  • 🍕 Feature
  • 🐛 Bug Fix
  • 📝 Documentation Update
  • 🎨 Style
  • 🧑💻 Code Refactor
  • 🔥 Performance Improvements
  • ✅ Test
  • 🤖 Build
  • 🔁 CI

Related Tickets & Documents

Fixes the regression that led to the revert of #2173.

Mobile & Desktop Screenshots/Recordings

(Logic change in dev-server plugin - no visual changes)

Added tests?

  • 👍 yes
  • 🙅 no, because they aren't needed
  • 🙋 no, because I need help

Added to documentation?

  • 📜 README.md
  • 📓 tech-docs
  • 🙅 no documentation needed

[optional] Are there any post-deployment tasks we need to perform?

None.

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