reactR icon indicating copy to clipboard operation
reactR copied to clipboard

Cannot reproduce reactR example

Open jienagu opened this issue 5 years ago • 5 comments

Hi,

I was not able to reproduce the "nivocal" example today by following this post (http://www.buildingwidgets.com/blog/2019/1/27/build-your-own-react-based-htmlwidget) using the latest version of reactR (0.4.0) and yarn (v1.16.0). I was able to reproduce it last month successfully but today when I built the htmlwidget using the same process, the viewer didn't render anything (white screen) without any warning or error messages through the process. Here is my repo: https://github.com/jienagu/nivocal

Here are some discrepancies I noticed:

  1. in https://nivo.rocks/calendar/ page, it seems like they add an additional note to make sure the parent container has a defined height
  2. instead of getting js file like last time, I got a jsx file (nivocal.jsx) following the process
  3. @nivo/calendar has been updated to 0.58.0

My OS is Windows10.

Thanks for any help in advance!

jienagu avatar May 17 '19 01:05 jienagu

Comparing https://github.com/jienagu/nivocal with https://github.com/react-R/nivocal, I found the discrepancy: inst>htmlwidgets: nivocal.js and nivocal.js.map are different. I am curious why these files are different using the same process?

jienagu avatar May 22 '19 23:05 jienagu

Hi, thanks for the report. I think the difference might be the version of the build tool used, but I don't know for sure. I'll try to reproduce today.

alandipert avatar Jul 09 '19 16:07 alandipert

@jienagu I was looking back over the issues and became worried that this was never resolved. Were you able to get it to work?

timelyportfolio avatar Jul 12 '20 13:07 timelyportfolio

Hi @timelyportfolio I haven't have time to try it out yet, I will try it this weekend and let you know! Thanks for noticing! :)

jienagu avatar Jul 13 '20 15:07 jienagu

I know I'm a little too late for this issue, but I know how to solve the problem. If you inspect the element, you would find a console.log error as

Uncaught ReferenceError: regeneratorRuntime is not defined

To solve the problem,

  1. add dependency in package.json (https://github.com/swsoyee/nivor/blob/main/package.json#L4)
  2. run yarn install to get the dependency.
  3. add 'regenerator-runtime/runtime.js' in entry (https://github.com/swsoyee/nivor/blob/main/webpack.config.js#L6)

reference: https://github.com/babel/babel/issues/9849#issuecomment-761773483

swsoyee avatar Feb 20 '21 15:02 swsoyee