Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
alycda opened this issue May 6, 2019 · 6 comments · Fixed by #3598
Closed
Labels

Comments

@alycda
Copy link

alycda commented May 6, 2019

Bug Report

Steps

Upgrade to 0.87 from 0.86

  1. yarn upgrade semantic-ui-react@0.87
  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'] } }

@welcome
Copy link

welcome bot commented May 6, 2019

👋 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.

@alycda
Copy link
Author

alycda commented May 6, 2019

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

@layershifter
Copy link
Member

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

layershifter added a commit that referenced this issue May 6, 2019
Reverts changes introduced in #3566, fixes #3597.
@layershifter layershifter pinned this issue May 6, 2019
layershifter added a commit that referenced this issue May 6, 2019
* chore(package): remove `browser` field

Reverts changes introduced in #3566, fixes #3597.

* Update package.json
@layershifter layershifter reopened this May 6, 2019
@layershifter
Copy link
Member

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

@levithomason
Copy link
Member

Release on the way, hang tight...

@levithomason
Copy link
Member

Fixed in semantic-ui-react@0.87.1

@layershifter layershifter unpinned this issue May 6, 2019
@triage-new-issues triage-new-issues bot removed the triage label May 6, 2019
mbakiev pushed a commit to mbakiev/Semantic-UI-React that referenced this issue Jun 17, 2019
* chore(package): remove `browser` field

Reverts changes introduced in Semantic-Org#3566, fixes Semantic-Org#3597.

* Update package.json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants