5

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

Mark
  • 1,069
  • 2
  • 21
  • 44

1 Answers1

8

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.

Daniel Schmidt
  • 11,605
  • 5
  • 38
  • 70