codesandbox / codesandbox/codesandbox-client
Vanilla (Parcel) Unreliable Behavior When index.html Under Other Path (for example, in src)
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 13.6k
- Forks
- 2.4k
- Avg merge
- 6d 19h
- Merged PRs (30d)
- 2
Description
🐛 bug report
Description of the problem
Using the Parcel bundler, the index.html file cannot be renamed or moved.
If the file is under a different path / name other than /index.html directly in the root, then there is unusual half-working unreliable behavior.
You can see this in the following sandboxes:
1. Index under /index.html: https://codesandbox.io/s/frozen-public-vanilla-parcel-bug-index-in-root-03p3w
With the index.html file in the root, everything works normally, including HTML from the HTML file itself.
The original DOM innerHTML of the body is as expected.

2. Index under /src/index.html: https://codesandbox.io/s/frozen-public-vanilla-parcel-bug-index-in-src-lcrew
With the index.html file in the src folder, some things work properly (such as modifying the document with JavaScript), but the DOM innerHTML content of the body is not stable and also does not match that of the HTML file.

Sometimes it even has CodeSandbox metadata in it:

How has this issue affected you? What are you trying to accomplish?
I want to be able to move and rename the index.html file as I wish, such as moving it under src/index.html.
Your Environment
| Software | Name/Version |
|---|---|
| Сodesandbox | PROD-1564153504-2b37aae59 |
| Browser | Chrome 76.0.3809.87 (Official Build) (64-bit) |
| Operating System | macOS 10.14.6 (18G84) |
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
Reproduce the two linked CodeSandbox examples, comparing a root index.html with src/index.html and the reported body innerHTML. Trace how Parcel handles the HTML entry path and why the generated DOM differs. Done means a renamed or moved HTML entry behaves consistently and preserves its source body content.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- build-system, frontend, web-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 32/100