`TypeError: appCache is undefined[Learn More]` when serving 0.0.0.0
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 2.3k
- Forks
- 641
- Avg merge
- 12h 4m
- Merged PRs (30d)
- 57
Description
Bug Template
Describe the bug
pxt serve is the only reliable way to share C++ code changes with others without deploying to makecode.com. By default, pxt serve binds to localhost. It is possible to tell pxt to bind to "ANY" by setting hostname to 0.0.0.0, however this produces very strange behavior.
To Reproduce
Steps to reproduce the behavior:
- Install a pxt project, such as
https://github.com/xobs/pxt-chibitronics/tree/rainbow-tape - Run
pxt serve --hostname 0.0.0.0 - A browser window opens. Change the address to the non-local interface address
- See error
Expected behavior
The server should work normally, as long as the "local token" is presented.
Screenshots
Add screenshots to help explain your problem. You can copy paste the screenshot in the github report. The .gif screen recording is very useful as well.

Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the problem with pxt serve --hostname 0.0.0.0 using the linked pxt-chibitronics project, then access the server through the non-local interface address. Investigate the pxt serve handling of the hostname and the browser error mentioning appCache; done means the server works normally when the local token is presented.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- cli, web-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100