codesandbox / codesandbox/codesandbox-client
App Only Works After Code Is Changed
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 13.6k
- Forks
- 2.4k
- Avg merge
- 6d 19h
- Merged PRs (30d)
- 2
Description
Hello, I played around with the @use-gesture/react and react-spring libraries and this very simple example from their docs sometimes just doesn't work in CSB. Not sure if it's an issue with the libraries or with the CSB client, but the weird thing is that just commenting out (or uncommenting) a console log statement or something else unrelated to the app makes it work. Somehow CSB doesn't do a full refresh when the code is changed, and this partial refresh seems to make it work while a full refresh doesn't:
https://codesandbox.io/s/dreamy-grass-v1j9fz?file=/src/App.js
There is a console log statement in line 16, at least in my browser (Chrome 101.0.4951.26 on ChromeOS 14588.41.0), the app never works on first load (i.e. you can't drag the square) but it works after commenting out the statement or putting in another unrelated statement.
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 the linked CodeSandbox reproduction and inspect src/App.js, especially the console log around line 16. Compare the initial load with the behavior after an unrelated edit, then determine whether the problem is in the libraries or the CSB client refresh path. Done means the square can be dragged on the first load without requiring a code change.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, react
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100