Expo App crashes in Production mode

My app crashes when I start to run it in production mode. In dev mode all works correctly. Only logs I have on the screen. What can I do?

Environment:

Expo CLI 4.0.13 environment info:
System:
OS: Linux 5.4 Ubuntu 20.04.1 LTS (Focal Fossa)
Shell: 5.0.17 - /bin/bash
Binaries:
Node: 14.15.1 - ~/.nvm/versions/node/v14.15.1/bin/node
Yarn: 1.22.5 - /usr/bin/yarn
npm: 6.14.8 - ~/.nvm/versions/node/v14.15.1/bin/npm
npmPackages:
expo: 38.0.10 => 38.0.10
react: ^17.0.1 => 17.0.1
react-dom: ^17.0.1 => 17.0.1
react-native: ~0.62.2 => 0.62.2
react-native-web: ~0.11.7 => 0.11.7
npmGlobalPackages:
expo-cli: 4.0.13
Expo Workflow: bare

I found solution. It’s all because of wrong auto import.

I have imported useState from “react/cjs/react.development”, not from ‘react’.

Instead

import { useState } from "react/cjs/react.development";

I need write

import React, { useState } from "react";

1 Like

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.