react-native-fetch-blob
react-native-fetch-blob copied to clipboard
Unexpected token import
I followed the setup instructions and get the following upon starting the react-native server:
/Users/.../node_modules/react-native-fetch-blob/index.js:5
import {
^^^^^^
SyntaxError: Unexpected token import
at createScript (vm.js:53:10)
...
I understand this has something to do with using babel.js, but I keep digging myself in circles.
Here's another user's StackOverflow question that needs answering.
having the same problem but only when running jest tests.
This should be able to fix the issue. Add to your jest setup.
"transform": {
"^.+\\.js$": "<rootDir>/node_modules/react-native/jest/preprocessor.js"
},