saurabhnemade / react-twitter-embed

Simplest way to add twitter widgets to your react project.
https://saurabhnemade.github.io/react-twitter-embed/
368 stars 66 forks source link

Web pack is throwing an error when trying to build bundle js #30

Open SamMalcolm opened 5 years ago

SamMalcolm commented 5 years ago

Getting a few errors thrown by web pack which look like this

ERROR in ./node_modules/react-twitter-embed/dist/index.es.js
Module not found: Error: Can't resolve '@babel/runtime/helpers/esm/possibleConstructorReturn'

Not sure what the issue is

forward88 commented 5 years ago

I am having same issue.

cymig commented 5 years ago

Same here: ERROR in ./node_modules/react-twitter-embed/dist/index.es.js Module not found: Error: Can't resolve '@babel/runtime/helpers/esm/classCallCheck' in '....../node_modules/react-twitter-embed/dist' @ ./node_modules/react-twitter-embed/dist/index.es.js 1:0-72 20:4-19 244:4-19 304:4-19 364:4-19 424:4-19 484:4-19 560:4-19 620:4-19 680:4-19 735:4-19

saurishkar commented 5 years ago

Same issue here Using Webpack 3.8.1


Module not found: Can't resolve '@babel/runtime/helpers/esm/classCallCheck' in '/Users/<my-project>/node_modules/react-twitter-embed/dist'
DanielVip3 commented 5 years ago

I'm having the same issue, and I think the problem is caused somehow by the building of the package in the dist folder.

Looks like that it references to too an unexisting directory of the @babel/runtime package, which is /esm/. This directory seems not to exist for me and for you, I think.

So, the actual workaround, working for me, is to downgrade to react-twitter-embed@2.0.4, because it looks like it works and seeks for the correct directories.

npm uninstall react-twitter-embed && npm install --save react-twitter-embed@2.0.4

I won't made a fork and a pull request just because I have no idea how this package is compiled/builded and I am not an expert about webpack or babel, but if someone could make a PR, that would be great.

saurabhnemade commented 5 years ago

This is weird. I am able to use it. Checking right now

saurabhnemade commented 5 years ago

Not sure. Found it working : https://stackblitz.com/edit/react-474wei

saurabhnemade commented 5 years ago

@DanielVip3 @saurishkar @SamMalcolm @forward88 @cymig Can anyone create a repository to reproduce the issue? I am unable to reproduce it as of now with 3.0.1.

oliverbienert commented 4 years ago

In this commit 43254026ff200b11d0445cb5e60f18078bf49f1e Babel were upgraded to Version 7, so version 2.0.4 was the last version that worked with babel 6. I had to upgrade to babel 7 as well to get it working again.