Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"ReferenceError: babelHelpers is not defined" in version 0.10.2 (not in 0.10.1) #160

Closed
davidxmoody opened this issue May 1, 2018 · 12 comments
Labels

Comments

@davidxmoody
Copy link

Reproduction demo

Steps to reproduce the problem

  1. I'm using material-ui beta 44 which uses react-popper as a dependency (bundled with create-react-app typescript scripts)

What is the expected behavior?

It should compile.

What went wrong?

I get the following error:

ReferenceError: babelHelpers is not defined
(anonymous function)
node_modules/react-popper/lib/Manager.js:5
  2 | import PropTypes from 'prop-types';
  3 | 
  4 | var Manager = function (_Component) {
> 5 |   babelHelpers.inherits(Manager, _Component);
  6 | 
  7 |   function Manager() {
  8 |     var _ref;

Any other comments?

Installing 0.10.1 manually fixes the problem. I can provide more info if necessary although given that the new version was only just released, I was hoping it would be an obvious fix.

Packages versions

  • Popper.js:
  • react-popper: 0.10.2
@FezVrasta
Copy link
Member

@virgofx since you worked on the 0.10.2 changes, may you have a look?

@TrySound
Copy link
Contributor

TrySound commented May 1, 2018

@FezVrasta external-helpers should be added only for rollup build. For babeled files it shouldn't not be added.

@TrySound
Copy link
Contributor

TrySound commented May 1, 2018

Here it can be moved to rollup config
https://github.com/FezVrasta/react-popper/blob/v0.x/.babelrc#L8

@virgofx
Copy link

virgofx commented May 1, 2018

Investigating

@FezVrasta
Copy link
Member

0.10.3 fixes it

@virgofx
Copy link

virgofx commented May 1, 2018

@TrySound @davidxmoody Can you check 0.10.3 and confirm fixed?

@FezVrasta
Copy link
Member

The babelhelpers are not referenced in the file anymore so hopefully yes.

https://unpkg.com/react-popper@0.10.3/lib/Manager.js

But I just noticed that the package.json points to an invalid main path, is it still related to your PR maybe?

@virgofx
Copy link

virgofx commented May 1, 2018

I actually didn't change the package.json file (not too familiar with the main or umd:main references). ... but the locations should be updated. I'm sure I could submit a new PR to update those. It seems like they should be updated (good catch).

Should the main point to the lib/react-popper.js or the CJS file? and umd:main to the new dist/umd/react-popper.min.js file?

@TheSharpieOne
Copy link
Contributor

also consider jsdelivr and unpkg properties in the package.json (and maybe even cdn). They are properties which help the CDNs determine which file to server.
See:
mjackson/unpkg#63
https://github.com/jsdelivr/jsdelivr#publishing-packages

@oliviertassinari
Copy link
Contributor

oliviertassinari commented May 1, 2018

0.10.3 introduces another problem. package.json references dist/react-popper.js but this file doesn't exist.

@oliviertassinari
Copy link
Contributor

oliviertassinari commented May 1, 2018

Fixed in 65c3fb5

@FezVrasta
Copy link
Member

0.10.4 should be fine hopefully

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants