Cannot resolve module 'babel-runtime/core-js/object/keys'
Seeing the following error after installing react-inline-auto-prefixer:
Module not found: Error: Cannot resolve module 'babel-runtime/core-js/object/keys' in /path/to/project/node_modules/auto-prefixer/dist
This is because the dist is requiring babel-runtime/core-js/object/keys and babel-runtime/core-js/object/assign directly rather than relying on the user to polyfill Object.keys and Object.values. Any reason for this?
Not sure what you mean, how could the user be responsible for that?
I'm not sure what the best way would be, but one way would be to check for the existence of Object.keys or Object.values and only require the babel-runtime polyfill if they don't exist. This way projects that use an alternate polyfill approach don't get a runtime error.
Object.keys for example is pretty widely supported at least in the browser world.
The point of this rep is to give old browsers compatibility, so I won't rely on native support.
But supplying external polyfills after native check is good Idea.
would you like to provide a PR?
The fist thing to do is to remove runtime from .babelrc, and then adding those polyfills (from MDN's site or somewhere else)
I'm having the same issue and seems it depends on OS:
ERROR in ./~/auto-prefixer/dist/react-inline-auto-prefixer.js
Module not found: Error: Cannot resolve module 'babel-runtime/core-js/object/assign' in /home/ubuntu/trigger_mail/node_modules/auto-prefixer/dist
@ ./~/auto-prefixer/dist/react-inline-auto-prefixer.js 3:21-67
On OS X everything works fine