Skip to content

react-dom could not be found within the project #2572

@tonypangs

Description

@tonypangs

Is there an existing issue for this?

  • I have searched the existing issues

Describe the issue

Problem

I am using storybook and tried to upgrade react native, relevant library's version.

It built successfully but got the error when opening the app

I tried to locate the error file and click into the require('...react-dom'). It works and redirect to that folder.

What could be the possible cause and fix for this issue? does anyone encounter before? Thanks!

  ../node_modules
  ../../../node_modules
  ../../../../../node_modules
  4 | exports.default = void 0;
  5 |
> 6 | var _reactDom = require("react-dom");
    |                          ^
  7 |
  8 | /**
  9 |  * Copyright (c) Nicolas Gallagher.

Environment

  "name": "mobile-stylesheet-example",
  "description": "Example app",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "android": "react-native run-android",
    "ios": "react-native run-ios --simulator='iPhone 14 Pro'",
    "start": "react-native start",
    "link": "react-native link",
    "build-react": "webpack --mode production",
    "start-react": "webpack-dev-server --config ./webpack.config.js --mode development",
    "storybook": "./node_modules/@storybook/react/bin/index.js -p 6007 --ci",
    "build-storybook": "./node_modules/@storybook/react/bin/build.js"
  },
  "dependencies": {
    "@react-navigation/drawer": "^6.6.3",
    "@react-navigation/native": "^6.1.7",
    "react": "18.2.0",
    "react-native": "0.71.12",
    "react-native-gesture-handler": "^2.12.1",
    "react-native-linear-gradient": "^2.8.2",
    "react-native-reanimated": "2.17.0",
    "react-native-safe-area-context": "^3.3.0",
    "react-native-screens": "^3.5.0",
    "react-native-web": "^0.19.7",
    "react-native-web-linear-gradient": "^1.1.2"
  },
  "devDependencies": {
    "@babel/core": "^7.20.12",
    "@babel/preset-env": "^7.20.0",
    "@babel/preset-react": "^7.20.0",
    "@babel/preset-typescript": "^7.20.0",
    "@babel/runtime": "^7.20.0",
    "@storybook/addon-actions": "^7.3.1",
    "@storybook/addon-essentials": "^7.3.1",
    "@storybook/addon-knobs": "^7.0",
    "@storybook/addon-links": "^7.3.1",
    "@storybook/addon-ondevice-actions": "^6.5.6",
    "@storybook/addon-ondevice-knobs": "^6.5.6",
    "@storybook/react": "^7.3.1",
    "@storybook/react-native": "^6.5.6",
    "@storybook/react-native-server": "^6.5.6",
    "@types/react": "^18.2.20",
    "@types/react-dom": "^18.2.7",
    "@types/react-native": "0.71.4",
    "@webpack-cli/serve": "^2.0.5",
    "autoprefixer": "^10.3.4",
    "babel-loader": "^9.1.3",
    "babel-plugin-module-resolver": "^5.0.0",
    "css-loader": "^6.8.1",
    "html-webpack-plugin": "^5.5.3",
    "metro-react-native-babel-preset": "0.73.10",
    "postcss": "^8.4.28",
    "postcss-loader": "^7.3.3",
    "react-dom": "^18.2.0",
    "style-loader": "^3.3.3",
    "ts-loader": "^9.4.4",
    "typescript": "4.8.4",
    "url-loader": "^4.1.1",
    "webpack": "^5.88.2",
    "webpack-cli": "^5.1.4",
    "webpack-dev-server": "^4.15.1"
  }
}

Expected behavior

It should works fine because react-dom is installed with corresponding version

Steps to reproduce

  • npx react-native run-ios

Test case

/

Additional comments

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions