3 ms·
this is my problem with Reactjs right now. I like it but debugging it is often difficult as hell. Thankfully my problems right now are small. With Hot module re
by mgr86 11y ago
this is my problem with Reactjs right now. I like it but debugging it is often difficult as hell. Thankfully my problems right now are small. With Hot module reloading I am constantly watching for signs of trouble. And can spot many quickly as they are introduced. But the stack trace is damn near foreign to me right now.
- novaleaf 11y agoif you switch to es6 classes, it helps. https://facebook.github.io/react/docs/reusable-components.html#es6-classes https://facebook.github.io/react/docs/reusable-components.ht...
- mgr86 11y agoI am using those.
- novaleaf 11y agoi use that + sourcemaps, and it seems pretty easy to debug. using Chrome + React Dev Extensions setting up sourcemaps to work properly is quite a pain though, most the browserify tooling via gulp or grunt does a pretty poor job of it.
- cozuya 11y agoActually gulp has many great ways to work with sourcemaps, browserify, and babel. Google it and you should find a gist. I'm using through2.
- novaleaf 11y agoI'm using typescript, which may impact my success, but really I don't get proper sourcemappings if I use uglify/browserify, or even the sourcemaps plugin. I only get proper sourcemaps if I use the tsify plugin + setting browserify debug=true. adding anything else causes sourcemaps to go out-of sync. That's OK though, as I get good sourcemaps in development and can live without it when in production.