Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to opt-in React DOM profiling without ejecting #4990

Open
dio opened this issue Sep 10, 2018 · 4 comments
Open

Allow to opt-in React DOM profiling without ejecting #4990

dio opened this issue Sep 10, 2018 · 4 comments
Milestone

Comments

@dio
Copy link

dio commented Sep 10, 2018

Is this a bug report?

No

Expected Behavior

CRA should be able to opt-in to React DOM profiling without ejecting.

Actual Behavior

Need to eject to enable React DOM profiling, as mentioned in https://gist.github.com/bvaughn/25e6233aeb1b4f0cdb8d8366e54a3977#create-react-app

@gaearon gaearon added this to the 2.x milestone Sep 10, 2018
@gaearon
Copy link
Contributor

gaearon commented Sep 10, 2018

Yeah we'll want to add this. In the meantime you can edit node_modules/react-scripts/config/webpack.config.prod.js. Won't persist the changes between installs but handy for local profiling.

@dio
Copy link
Author

dio commented Sep 10, 2018

Got it. Thank you @gaearon for a quick reply!

@jpierson-at-riis
Copy link

I'm having trouble getting the Profiling tools working in Chrome while using CRA start script via npm start. When I look for the above mentioned file node_modules/react-scripts/config/webpack.config.prod.js to attempt a workaround I don't see it in node_modules.

image

I'm also not sure why I'm getting the following message in the dev tools seeing that I'm using an adequate version of react (18.2.0 with react-scripts 5.0.1) and a non-production build (npm start).

Profiling not supported.
Profiling support requires either a development or profiling build of React v16.5+.

Learn more at reactjs.org/link/profiling.

Is there still a workaround to getting the profiling working locally or should this already be working out of the box?

@jpierson-at-riis
Copy link

jpierson-at-riis commented May 24, 2023

Interesting, I must have been hitting something different because after a bit of tinkering I tried removing the custom environment variables that I have set up for our project to set the PORT and HTTP variables and that seems to have allowed the profiler to work. Specifically it seems that setting PORT to a custom value of 8281 had caused the profile feature to stop working in the Chrome React DevTools Extension. Perhaps this is a detail of how that extension specifically activates or is to the webpack build in CRA that perhaps is disabling profiling when not running on port 3000 specifically?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants