admin管理员组文章数量:1399981
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/ponents/UserPage/UserPageQuestion/UserPageQuestion.js Module not found: Error: Can't resolve 'semantic-ui-react' in 'C:\Users\1Sun\Cebula3\cebula_react\assets\ponents\UserPage\UserPageQuestion' @ ./assets/ponents/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/ponents/UserPage/index.js @ ./assets/ponents/UserPage/UserPage.js @ multi ./assets/ponents/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??
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/ponents/UserPage/UserPageQuestion/UserPageQuestion.js Module not found: Error: Can't resolve 'semantic-ui-react' in 'C:\Users\1Sun\Cebula3\cebula_react\assets\ponents\UserPage\UserPageQuestion' @ ./assets/ponents/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/ponents/UserPage/index.js @ ./assets/ponents/UserPage/UserPage.js @ multi ./assets/ponents/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??
Share Improve this question asked Sep 30, 2018 at 1:28 1Sun1Sun 2,3655 gold badges15 silver badges22 bronze badges 1- why have you imported semantic.min.* ? – Amir-Mousavi Commented Sep 30, 2018 at 2:42
2 Answers
Reset to default 5In 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
You can use the following to solve your problem:
export default UserPageQuestion
本文标签: javascriptCan39t resolve 39semanticuireact39Stack Overflow
版权声明:本文标题:javascript - Can't resolve 'semantic-ui-react' - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744161081a2593337.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论