Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/reactjs/21.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Reactjs 未找到模块:Can';t解决';//图片/果冻';在';C:\Users\MSI\Desktop\cake-app\src\Components\Product';_Reactjs_Svg_Webpack_Components_Babeljs - Fatal编程技术网

Reactjs 未找到模块:Can';t解决';//图片/果冻';在';C:\Users\MSI\Desktop\cake-app\src\Components\Product';

Reactjs 未找到模块:Can';t解决';//图片/果冻';在';C:\Users\MSI\Desktop\cake-app\src\Components\Product';,reactjs,svg,webpack,components,babeljs,Reactjs,Svg,Webpack,Components,Babeljs,请有人帮我修复此错误。我不明白错误的原因 import React from 'react' import styled from 'styled-components' import CustomButton from "../CustomButton/CustomButton"; import logo from "../../images/jelly"; // svg icon // I also tried this method but I

请有人帮我修复此错误。我不明白错误的原因

import React from 'react'
import styled from 'styled-components'
import CustomButton from "../CustomButton/CustomButton"; 
import logo from "../../images/jelly"; // svg icon  
// I also tried this method but I got the same error
// import { ReactComponent as Logo } from "../../images/jelly"; 


const Product = () => {
    return (
        <Wrapper>
            <img src={logo} alt="logo" />
            {/* <Logo></Logo> */}
            <div className="content">
                <h4>Chocolate</h4> 
                <p>Lorem ipsum dolor sit amet consectetur adipisicing elit.</p>
             </div>
             <CustomButton>$20 | Order Now </CustomButton>
        </Wrapper>
    )
}

export default Product

const Wrapper = styled.div``
从“React”导入React
从“样式化组件”导入样式化
从“./CustomButton/CustomButton”导入CustomButton;
从“../../images/jelly”//svg图标
//我也尝试过这种方法,但我得到了同样的错误
//从“../../images/jelly”导入{ReactComponent as Logo};
常数乘积=()=>{
返回(
{/*  */}
巧克力
我的同僚们都是精英

20美元|立即订购 ) } 导出默认产品 const Wrapper=styled.div``

您需要在文件名中添加.svg:
从“./../images/jelly.svg”导入徽标

谢谢。它工作正常:)