Open DoctorHowser opened 6 years ago
Facing the same problem deploying to Netlify ^^
@DoctorHowser probably not the perfect solution but I just copied this file into my project. Avoid babel altogether as it is not needed for create react app (assuming you are also using that): https://github.com/joshjg/react-canvas-knob/blob/master/Knob.js
@funador thank you, I couldn't figure out where this error was coming from.
@DoctorHowser probably not the perfect solution but I just copied this file into my project. Avoid babel altogether as it is not needed for create react app (assuming you are also using that): https://github.com/joshjg/react-canvas-knob/blob/master/Knob.js
@funador thank you! Could have saved 3 hrs if I had just done what you did. I dived deep into babel's and webpack's configuration mess.
@funador thank you 🙏 Sometimes you need to think easier)) We usually try to solve it in a difficult way)) and the solution is sometimes very close.
Hi, @DoctorHowser , @abdu355, @funador how are you today, I faced same issue with @DoctorHowser . so I read @funador 's comment. but I don't know where should I copy the Knob.js. could you tell me about it in detail? thanks.
Hey Folks,
I'm using the react canvas knob component, and have everything working locally. When I make a production build, I get the folowing error:
index.js:51 Uncaught Error: locals[0] does not appear to be a
moduleobject with Hot Module replacement API enabled. You should disable react-transform-hmr in production by using
envsection in Babel configuration. See the example in README: https://github.com/gaearon/react-transform-hmr
A couple questions -- Is using
react-transform-hmr
needed? Dan Abramov's overall advice to avoid the error is to switch to https://github.com/gaearon/react-hot-loaderIf it's not possible to change dependencies, we should document that this code will break in production environments/needs to have production configuration. Does this exist someplace and I missed it?
Thanks!