1Sun
1Sun

Reputation: 2365

Can't resolve 'semantic-ui-react'

I think I followed all steps for set up 'semantic-ui-react' that other said to do but there is an error.

ERROR in ./assets/components/UserPage/UserPageQuestion/UserPageQuestion.js Module not found: Error: Can't resolve 'semantic-ui-react' in 'C:\Users\1Sun\Cebula3\cebula_react\assets\components\UserPage\UserPageQuestion' @ ./assets/components/UserPage/UserPageQuestion/UserPageQuestion.js 31:0-67 91:63-70 91:98-104 93:29-35 93:76-81 95:31-38 95:66-72 98:29-35 100:42-47 @ ./assets/components/UserPage/index.js @ ./assets/components/UserPage/UserPage.js @ multi ./assets/components/UserPage/UserPage.js

package.json

...

"dependencies": {
    ...
    "semantic-ui-css": "^2.3.3",
    "semantic-ui-react": "^0.82.4",
    ...
  }

...

UserPageQuestion.js

import { Dimmer, Loader, Image, Segment } from 'semantic-ui-react'

import '../../../../../static/cebula/Semantic-UI-CSS-master/semantic.min.js';
import '../../../../../static/cebula/Semantic-UI-CSS-master/semantic.min.css';

const UserPageQuestion = () => {
     return (
          <Segment>
                 <Dimmer active>
                       <Loader>Loading</Loader>
                 </Dimmer>
                 <Image src='/images/wireframe/short-paragraph.png' />
          </Segment>
     )

}

What's the problem??

Upvotes: 2

Views: 11082

Answers (2)

Amir-Mousavi
Amir-Mousavi

Reputation: 4563

You can use the following to solve your problem:

export default UserPageQuestion

Upvotes: 0

jbarros
jbarros

Reputation: 638

In your UserPageQuestion.js remove the following 2 imports:

import '../../../../../static/cebula/Semantic-UI-CSS-master/semantic.min.js';
import '../../../../../static/cebula/Semantic-UI-CSS-master/semantic.min.css';

Just include the minified CSS file in your index.js file:

import 'semantic-ui-css/semantic.min.css';

Source: Semantic UI docs

Upvotes: 5

Related Questions