Semantic-ui-react: Module not found: Can't resolve 'React' in '/srv/node_modules/semantic-ui-react/dist/umd'

Created on 6 May 2019  路  6Comments  路  Source: Semantic-Org/Semantic-UI-React

Bug Report

Steps

Upgrade to 0.87 from 0.86

  1. yarn upgrade [email protected]
  2. restart webpack

Expected Result

webpack dev server compiles

Actual Result

Failed to compile
./node_modules/semantic-ui-react/dist/umd/semantic-ui-react.min.js
Module not found: Can't resolve 'React' in '/srv/node_modules/semantic-ui-react/dist/umd'
This error occurred during the build time and cannot be dismissed.

Version

0.87.0

EDIT our webpack config DOES NOT include { resolve: { aliasFields: ['browser'] } }

bug

Most helpful comment

All 6 comments

馃憢 Thanks for opening your first issue here! If you're reporting a 馃悶 bug, please make sure you've completed all the fields in the issue template so we can best help.

We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can.

Started with a fresh CRA app, and got:

Failed to compile
./node_modules/semantic-ui-react/dist/umd/semantic-ui-react.min.js
Module not found: Can't resolve 'ReactDOM' in '/Users/max/Desktop/cra-sui/node_modules/semantic-ui-react/dist/umd'

steps to reproduce:

  1. npx create-react-app ./
  2. yarn add semantic-ui-react
  3. add import { Button } from 'semantic-ui-react'; to src/App.js

package.json

{
  "name": "cra-sui",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "react": "^16.8.6",
    "react-dom": "^16.8.6",
    "react-scripts": "3.0.0",
    "semantic-ui-react": "^0.87.0"
  },
  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test",
    "eject": "react-scripts eject"
  },
  "eslintConfig": {
    "extends": "react-app"
  },
  "browserslist": {
    "production": [
      ">0.2%",
      "not dead",
      "not op_mini all"
    ],
    "development": [
      "last 1 chrome version",
      "last 1 firefox version",
      "last 1 safari version"
    ]
  }
}

yarn.lock.zip

Confirmed, caused by #3566. umd build should not be used by default.

Fixed in #3598, will keep opened until next release.

Release on the way, hang tight...

Was this page helpful?
0 / 5 - 0 ratings