Cannot reproduce reactR example
jienagu opened this issue · 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:
- in https://nivo.rocks/calendar/ page, it seems like they add an additional note to make sure the parent container has a defined height
- instead of getting js file like last time, I got a jsx file (nivocal.jsx) following the process
- @nivo/calendar has been updated to 0.58.0
My OS is Windows10.
Thanks for any help in advance!
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?
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.
@jienagu I was looking back over the issues and became worried that this was never resolved. Were you able to get it to work?
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! :)
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,
- add dependency in package.json (https://github.com/swsoyee/nivor/blob/main/package.json#L4)
- run
yarn install
to get the dependency. - add
'regenerator-runtime/runtime.js'
in entry (https://github.com/swsoyee/nivor/blob/main/webpack.config.js#L6)
reference:
babel/babel#9849 (comment)