jodhman / react-eyedrop

Seamlessly integrate a static typed, fully-tested color-picking React component/hook!
24 stars 11 forks source link

Uncaught TypeError: html2canvas_1.default is not a function #30

Closed rtwayland closed 3 years ago

rtwayland commented 3 years ago

Hello! I'm getting this error: Uncaught TypeError: html2canvas_1.default is not a function when the click event target is anything other than the image. If I go into node_modules/react-eyedrop/dist/useEyeDrop.js and remove .default from line 38, everything works fine. I know you are using TypeScript for your library, and I found this issue which might be related to the issue I am opening here: https://github.com/niklasvh/html2canvas/issues/1440#issuecomment-554042284

Thanks for your work and for a very useful tool!

jodhman commented 3 years ago

Hey @rtwayland! Oh no! I better get that sorted asap. Before I start debugging, I just need to confirm which version of react-eyedrop you're using. Oh, and I'm really glad you find it useful :-)

rtwayland commented 3 years ago

I’m on 5.1.2. You can reproduce it by running the example app, but replacing the import from ’./package’ with the npm package.

jodhman commented 3 years ago

Nice catch. I need to become more attentive to these things... :thinking: :thought_balloon: Or cover it with more tests. The issue should be resolved in 5.1.3.

rtwayland commented 3 years ago

Fantastic! Thanks for your responsiveness! I just upgraded and it works great.

jodhman commented 3 years ago

Oh, that's wonderful! :rocket: