0
import React from 'react';
import logo from '../assets/img/ktasia.png';

const sectionThree = () => {
    return(
        <section className='sectionThree'>
            <div className='tzoid shadow-lg'>
                <img src={logo} alt="ktasia" />
            </div>
        </section>
    )
}

export default sectionThree;

Here is the error

Module not found: Error: Can't resolve '../assets/img/kt-asia.png' in '/Users/kielabes/Desktop/Alvin/learning of react/my-app/src/components/SectionThree'

ERROR in ./src/components/SectionThree/SectionThree.scss (./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[1].oneOf[7].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[1].oneOf[7].use[2]!./node_modules/resolve-url-loader/index.js??ruleSet[1].rules[1].oneOf[7].use[3]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[1].oneOf[7].use[4]!./src/components/SectionThree/SectionThree.scss) 5:36-89

Module not found: Error: Can't resolve '../assets/img/kt-asia.png' in '/Users/kielabes/Desktop/Alvin/learning of react/my-app/src/components/SectionThree'

webpack compiled with 1 error

I tried to change the directory like './../../assets/img/ktasia.png'

  • It's possible that you need to add a rule to your webconfig. Also check out this https://stackoverflow.com/questions/43823289/how-to-import-image-svg-png-in-a-react-component – dsudo Oct 28 '22 at 07:54

0 Answers0