React "react-scripts start" fails in new Codespace #26365
-
Hi all, I’m running into a reproducible issue when trying to run a newly created React app. I can reproduce this on a new repository:
And some versions for reference:
FYI on my local machine (Mac OS) this runs normally; I’m only experiencing this in a Codespace. Anyone else experiencing this? Any ideas what’s going on? 😅 |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments
-
Update: I discovered a workaround:
This starts the React development server normally in the Codespace. |
Beta Was this translation helpful? Give feedback.
-
It looks like the We’ll think through how we can make this scenario work better out of the box. |
Beta Was this translation helpful? Give feedback.
-
Thanks John, I will use that in my start script! 👍 Much better solution than sudo. In addition, I noticed that a Advanced Configuration | Create React AppYou can adjust various development and production settings by setting environment variables in your shell or with .env. |
Beta Was this translation helpful? Give feedback.
-
@edwinhollen, following up, we’ve fixed this so that it works like you’d expect without having to disable the browser. You can remove the Internally, you’ll notice that VS Code is now setting the |
Beta Was this translation helpful? Give feedback.
-
Amazing, thank you for investigating John, and I’m a big fan of Codespaces :slight_smile: Keep up the great work! |
Beta Was this translation helpful? Give feedback.
It looks like the
react-dev-utils
package is trying to open the browser from the remote container, which is failing. In Codespaces, we really want to launch the browser on the client side, not the remote side. If you first runexport BROWSER=none
before runningyarn start
, it works since it skips trying to launch the browser on the remote side.We’ll think through how we can make this scenario work better out of the box.