Skip to content

Uncaught Error: Cannot find module 'babel-runtime/helpers/get' from 'semantic-ui-react/dist/commonjs/modules/Dropdown/Dropdown.js' #1260

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

Closed
amshim opened this issue Jan 31, 2017 · 16 comments
Labels

Comments

@amshim
Copy link

amshim commented Jan 31, 2017

Semantic-UI-React Version: ^0.64.5 (Latest)

I get the following error when trying to import "semantic-ui-react" into any of my React components. I have tried installing babel-runtime to my dev packages, but still no luck. I am not even trying to use dropdown menus.

https://i.gyazo.com/34702d671ae499a2e419d62af995bfd4.png

@layershifter
Copy link
Member

@amshim Try to remove node_modules folder and then npm i, seems you have same issue like in #1229.

@levithomason
Copy link
Member

Hm, though this is likely true, we should actually have babel-runtime as a peerDependency I believe. Since the commonjs modules need to require it.

@amshim
Copy link
Author

amshim commented Feb 3, 2017

Try to remove node_modules folder and then npm i, seems you have same issue like in #1229.

I tried this and it does not resolve the issue. Error still comes up.

@levithomason
Copy link
Member

@amshim please try npm i babel-runtime then run a build. Our commonjs components are transformed to require modules from babel-runtime. If you do not have it, then it will fail.

If that ^ works for you, probably will, then we just need to add this package as a peerDependency to our package.

@JulianIsrael
Copy link

having same issue importing semantic-ui-react using jspm

@levithomason
Copy link
Member

Could someone please first install babel-runtime then try again and let me know what happens? Almost certain this is the issue but I need some conformation before I ship a fix.

@amshim
Copy link
Author

amshim commented Feb 5, 2017

Could someone please first install babel-runtime then try again and let me know what happens? Almost certain this is the issue but I need some conformation before I ship a fix.

I tried this and the problem still persisted.

@JulianIsrael
Copy link

the problem still there.

@levithomason
Copy link
Member

Thanks much guys! In that case, anyone able to create a minimal repo that reproduces this error? We'll have to dig in a bit more it appears.

@JulianIsrael
Copy link

JulianIsrael commented Feb 6, 2017

git clone https://github.com/JulianIsrael/semantic-ui-jspm-issue.git
npm run init

when it finishes, it will open a browser and see the console error with the import. Versions before the 0.64.0 release works.

@layershifter
Copy link
Member

layershifter commented Feb 7, 2017

Okay, I made it working. I've added bs-config.json:

{
  "watchOptions": {
    "ignored": ["node_modules", "jspm_packages" ]
  }
}

Then jspm install babel-runtime and npm run start, all works. @JulianIsrael can you confirm?


@levithomason Seems we need add babel-runtime to dependencies.

@scholtzm
Copy link

Possibly related?

facebook/create-react-app#1421

In my case, the issue just "went away". Not sure where the actual culprit was hidden. 🤔

@tslater
Copy link
Contributor

tslater commented Feb 10, 2017

We get this issue intermittently, only in our CI setup, as well. It's really strange why it shows up there and not locally.

@levithomason
Copy link
Member

OK folks, PR up. Thanks for all the extra work trialing things here. This should most certainly fix all the issues noted here. Will try to get release out tonight.

@levithomason
Copy link
Member

Released in [email protected].

@tslater
Copy link
Contributor

tslater commented Feb 12, 2017

Awesome work...like always! Thanks @levithomason!

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