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

Can't resolve babel-runtime - doesn't work with Babel v7 #228

Closed
saltire opened this issue Aug 30, 2018 · 3 comments · Fixed by #278
Closed

Can't resolve babel-runtime - doesn't work with Babel v7 #228

saltire opened this issue Aug 30, 2018 · 3 comments · Fixed by #278
Labels

Comments

@saltire
Copy link

saltire commented Aug 30, 2018

Building a project that includes emoji-mart but not babel-runtime fails:

ERROR in ./node_modules/emoji-mart/dist-es/utils/index.js
Module not found: Error: Can't resolve 'babel-runtime/core-js/object/keys' in '[...]/node_modules/emoji-mart/dist-es/utils'

ERROR in ./node_modules/emoji-mart/dist-es/components/skins.js
Module not found: Error: Can't resolve 'babel-runtime/helpers/classCallCheck' in '[...]/node_modules/emoji-mart/dist-es/components'

...etc.

I see in .babelrc that some Babel imports are aliased to polyfills by the module-resolver plugin, but not all of them, so the dist files depend on packages that aren't necessarily installed.

For example, this can happen if a project is using Babel v7, which has different package names.

Perhaps the project should explicitly include Babel in dependencies instead of devDependencies, or else make sure all the imports are covered by polyfills?

@NikolasStelmah
Copy link

Did anyone fix this trouble in any way? I faced it with Babel 7, and find no way to resolve uncompability, except make a fork of emoji-mart and try to update Babel.

@saltire saltire changed the title Can't resolve babel-runtime Can't resolve babel-runtime - doesn't work with Babel v7 Nov 13, 2018
@Jikstra
Copy link

Jikstra commented Jan 25, 2019

Did anyone fix this trouble in any way? I faced it with Babel 7, and find no way to resolve uncompability, except make a fork of emoji-mart and try to update Babel.

Currently i have this on one of the projects i'm working on. A quick fix is to just require the babel-runtime dependency in the package.json. Having a project which uses emoji-mart, you can reproduce this error by deleting all dev dependencies with npm prune --production.

@nolanlawson
Copy link

It seems like another reasonable fix would be for emoji-mart to not bundle babel-runtime in its dist files.

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

Successfully merging a pull request may close this issue.

4 participants