🐛 BUG: Astro doesn't render properly in GitHub Codespaces on dev mode
What version of astro are you using?
1.0.0-beta.72
Are you using an SSR adapter? If so, which one?
None
What package manager are you using?
pnpm
What operating system are you using?
Linux
Describe the Bug
On GitHub Codespaces there is an issue in dev mode where Astro will return HTML as a text file.
If you run
astro previewthis issue isn't there
The issue looks like this,

The error occurs on all example templates, this is an example repro, but it occurs on all examples https://github.com/okikio/astro-codespaces-error-repro
Link to Minimal Reproducible Example
https://stackblitz.com/github/okikio/astro-codespaces-error-repro
Participation
- [x] I am willing to submit a pull request for this issue.
Thanks @okikio! It's hard to tell if this is an issue on our end or with Codespaces. Any chance you can look into this more?
I wonder if changing anything about the Codespaces settings helps here?
@natemoo-re I'm not sure either, @ran-dall thought changing the Dockerfile would solve the problem, but it didn't. From what I can tell, this is an Astro issue as it only affects the dev mode server, but the preview server works as expected.
If you'd like, I can have a debug sesh after work today.
I was able to replicate @okikio problem a few different ways, which makes me think it isn't something we're doing (at Astro) but rather an interaction of how GitHub is forwarding the Local Ports thru their Authentication. You don't get the problem if you use the GitHub CodeSpaces extension on MS Edge or directly from within VSCode. The problem is solely when you're using CodeSpaces from a browser window.
That said, Firefox doesn't even connect to CodeSpaces in this context due to it triggering Security Violations.
Therefore, I'm pretty certain this is a limitation of CodeSpaces...and I'm currently working with GitHub to push the problem to the right people there.
That's awesome 👌
Just encountered this problem too. This used to work, it only stopped working a few weeks ago.