React is not defined while using Mobx in production build but working fine in dev

I am working on the Shopify node app and the front end works with Vite.
I am using Mobx 6 for state management with a structure like Mobx 5 and it is working fine in development mode but not working when I build it and try to deploy it on the server it shows an error.

ReferenceError: React is not defined
    at mobxreact.esm.js:416:18
    at ow (react-dom.production.min.js:157:137)
    at IE (react-dom.production.min.js:176:260)
    at BP (react-dom.production.min.js:269:165)
    at FP (react-dom.production.min.js:250:347)
    at r6 (react-dom.production.min.js:250:278)
    at Sf (react-dom.production.min.js:250:138)
    at X1 (react-dom.production.min.js:243:163)
    at react-dom.production.min.js:123:115
    at e.unstable_runWithPriority (scheduler.production.min.js:18:343)

and here is the other configurations

package file

{
  "name": "shopify-frontend-template-react",
  "version": "1.0.0",
  "private": true,
  "license": "UNLICENSED",
  "scripts": {
    "build": "vite build",
    "dev": "vite",
    "coverage": "vitest run --coverage"
  },
  "type": "module",
  "engines": {
    "node": ">= 12.16"
  },
  "stylelint": {
    "extends": "@shopify/stylelint-polaris"
  },
  "dependencies": {
    "@formatjs/intl-locale": "^3.3.2",
    "@formatjs/intl-localematcher": "^0.4.0",
    "@formatjs/intl-pluralrules": "^5.2.4",
    "@shopify/app-bridge": "^3.7.7",
    "@shopify/app-bridge-react": "^3.7.7",
    "@shopify/i18next-shopify": "^0.2.3",
    "@shopify/polaris": "^10.49.1",
    "@types/node": "^20.10.0",
    "@vitejs/plugin-react": "1.2.0",
    "antd": "^5.10.1",
    "axios-auth-refresh": "^3.3.6",
    "bootstrap": "^5.3.2",
    "clsx": "^2.0.0",
    "formik": "^2.4.5",
    "i18next": "^23.1.0",
    "i18next-resources-to-backend": "^1.1.4",
    "jsonwebtoken": "^9.0.2",
    "mobx": "^6.10.2",
    "mobx-react": "^9.1.1",
    "path": "^0.12.7",
    "react": "^17.0.2",
    "react-bootstrap": "^2.9.0",
    "react-dom": "^17.0.2",
    "react-google-recaptcha": "^3.1.0",
    "react-i18next": "^13.0.0",
    "react-query": "^3.34.19",
    "react-router-dom": "^6.17.0",
    "react-textarea-autosize": "^8.5.3",
    "reactstrap": "^9.2.2",
    "sass": "^1.69.5",
    "simplebar-react": "^3.2.4",
    "vite": "^5.0.2",
    "vite-tsconfig-paths": "^4.2.1",
    "yup": "^1.3.2"
  },
  "devDependencies": {
    "@shopify/stylelint-polaris": "^12.0.0",
    "history": "^5.3.0",
    "jsdom": "^19.0.0",
    "prettier": "^2.6.0",
    "stylelint": "^15.6.1",
    "vi-fetch": "^0.6.1"
  }
}

vie.config.js

import { defineConfig } from "vite";
import { dirname } from "path";
import { fileURLToPath } from "url";
import react from "@vitejs/plugin-react";

if (
  process.env.npm_lifecycle_event === "build" &&
  !process.env.CI &&
  !process.env.SHOPIFY_API_KEY
) {
  console.warn(
    "nBuilding the frontend app without an API key. The frontend build will not run without an API key. Set the SHOPIFY_API_KEY environment variable when running the build command.n"
  );
}

const proxyOptions = {
  target: `http://127.0.0.1:${process.env.BACKEND_PORT}`,
  changeOrigin: false,
  secure: true,
  ws: false,
};

const host = process.env.HOST
  ? process.env.HOST.replace(/https?:///, "")
  : "localhost";

let hmrConfig;
if (host === "localhost") {
  hmrConfig = {
    protocol: "ws",
    host: "localhost",
    port: 64999,
    clientPort: 64999,
  };
} else {
  hmrConfig = {
    protocol: "wss",
    host: host,
    port: process.env.FRONTEND_PORT,
    clientPort: 443,
  };
}

export default defineConfig({
  build: {
    sourcemap: 'inline',
  },
  define: {
    'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV === 'production' ? 'production' : 'development'),
  },
  plugins: [react({ jsxRuntime: 'automatic' })],
  root: dirname(fileURLToPath(import.meta.url)),
  resolve: {
    preserveSymlinks: true,
    alias: {
      utils: '/utils',
      pages: '/pages',
      store: '/store',
      hooks: '/hooks',
      assets: '/assets',
      services: '/services',
      constants: '/constants',
      components: '/components',
    },
  },
  server: {
    host: "localhost",
    port: process.env.FRONTEND_PORT,
    hmr: hmrConfig,
    proxy: {
      "^/(\?.*)?$": proxyOptions,
      "^/api(/|(\?.*)?$)": proxyOptions,
      "^/webhooks(/|(\?.*)?$)": `http://127.0.0.1:${process.env.BACKEND_PORT}`,
    },
  },
});

store index file

import ObservableAuthStore from "./authStore/authStore";
import ObservableModalStore from "./modalStore/modalStore";
import ObservableGatewayStore from "./gateway/gatewayStore";
import ObservableShopifyStore from "./shopify/shopifyStore";
import ObservableTemplateStore from "./templateStore/templateStore";
import ObservableDashboardStore from "./dashboardStore/dashboardStore";

class RootStore {
  constructor() {
    this.authStore = ObservableAuthStore;
    this.modalStore = ObservableModalStore;
    this.gatewayStore = ObservableGatewayStore;
    this.shopifyStore = ObservableShopifyStore;
    this.templateStore = ObservableTemplateStore;
    this.dashboardStore = ObservableDashboardStore;
  }
}

export default RootStore;

inside store

import { makeAutoObservable, observable, runInAction } from "mobx";
import { getCustomers } from "services/index";
import React from "react";

class ObservableShopifyStore {

    customerList = [];
    response = undefined;


    getShopifyCustomers = async () => {
        const list = await getCustomers();
        try {
            runInAction(() => {
                this.customerList = list?.data;
            });
        } catch (error) {
            runInAction(() => {
                this.response = error;
            })
        }
        return this.customerList;
    }




    constructor() {
        makeAutoObservable(this, {
            customerList: observable,
        })
    }
}

export default new ObservableCustomerStore;

App.jsx

import React from 'react'
import { ConfigProvider } from "antd";
import { Provider } from "mobx-react";
import { Toaster } from "react-hot-toast";
import { loadState } from "./store/initial";
import { BrowserRouter } from "react-router-dom";
import AuthorizedPages from "./routes/Authorized";
import { toastConfig } from "./constants/constants";
import UnauthorizedPages from "./routes/Unauthorized";
import { AppBridgeProvider } from "components/providers";

import RootStore from "./store";

const state = new RootStore();
loadState(state);

export default function App() {
  const { token: isTokenAvailable } = state.authStore;

  return (
    <BrowserRouter>
      <ConfigProvider>
        <Provider store={state}>
          <AppBridgeProvider>
            <Toaster {...toastConfig} />
            {isTokenAvailable ? <AuthorizedPages /> : <UnauthorizedPages />}
          </AppBridgeProvider>
        </Provider>
      </ConfigProvider>
    </BrowserRouter>
  );
}

help to resolve the issue i can’t able to find what is the problem, i imported React in every file but still error occurs in production.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật