Mark
Mark

Reputation: 1099

Couldn't find preset "module:react-native-dotenv"

I setup a test with Detox, but when I launch it with detox test, the test starts but I receive this error:

Couldn't find preset "module:react-native-dotenv" relative to directory "/Users/iota/workspace/Project"

In the scene file I am trying to test I have this: import { BASE_URL, GOOGLE_APP_ID } from 'react-native-dotenv';

My .babelrc file:

{
  "presets": [
    "module:react-native-dotenv",
    "module:metro-react-native-babel-preset"
  ]
}

Any hint?

UPDATE

If I remove the line module:react-native-dotenv, I have a similar error for the module:metro-react-native-babel-preset

Upvotes: 5

Views: 7967

Answers (1)

Daniel Schmidt
Daniel Schmidt

Reputation: 11921

You need to install the presets using npm, so a

npm install --save-dev metro-react-native-babel-preset react-native-dotenv

should solve the issue.

Upvotes: 8

Related Questions