codesandbox / codesandbox/codesandbox-client
Using style file makes hmr fail
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
Preflight Checklist
- I have read the Contributing Guidelines for this project.
- I agree to follow the Code of Conduct that this project
adheres to. - I have searched the issue tracker for an issue that matches the one I want
to file, without success.
Description of the problem
Using less file make hmr fail
How has this issue affected you? What are you trying to accomplish?
Using less file make hmr fail. And when I just change the text in the index.js, it stills refresh the page.
When I delete one line code in the inset-css.ts, hmr works well although the less file is still in the code.(in my self-host sandpack )

To Reproduce
https://codesandbox.io/s/sweet-joana-ge6tc
Your Environment
| Software | Name/Version |
|---|---|
| Сodesandbox | Latest |
| Browser | Chrome/96.0.4664.110 |
| Operating System | MacOS/11.5.2 |
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 with packages/app/src/sandbox/eval/transpilers/style/utils/insert-css.ts and reproduce the behavior in the linked CodeSandbox example. Compare HMR behavior when the Less file is present with the reported change to index.js. Done means edits update without a full page refresh and HMR still works with the style file included.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, typescript
- Domain
- devtools, frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100