ljharb / prop-types-tools

Custom React PropType validators
MIT License
671 stars 50 forks source link

SyntaxError: Unexpected identifier on `forbidExtraProps` from `prop-types-exact` #52

Closed pedropalau closed 5 years ago

pedropalau commented 5 years ago

Good work with this repo. I'm getting this error when testing with Jest, also the same error occurs with TypeScript.

.../node_modules/airbnb-prop-types/src/forbidExtraProps.js:1
(function (exports, require, module, __filename, __dirname) { import forbidExtraProps from 'prop-types-exact';
                                                                     ^^^^^^^^^^^^^^^^
....
SyntaxError: Unexpected identifier
....

I'm using Babel 7.

ljharb commented 5 years ago

The implication is that you're not transforming modules in your babelrc, or that babel-jest isn't set up properly.