Error: ENOENT: no such file or directory for react-ionicons

538 Views Asked by At

I installed react-ionicons by using the below comment

npm i react-ionicons

and in my js file, I have the below code. I was able to see the icon in my screen, however in the console. I got lots of error and warning.

import { Airplane } from 'react-ionicons'

const res = () => {
            <Airplane
                color={'#fff'} 
                title={'airplane'}
                height="30px"
                width="30px"
            />
}
.....

WARNING in ./node_modules/react-ionicons/lib/index.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/Users/az/project1/node_modules/react-ionicons/lib/WomanOutline.js.map' file: Error: ENOENT: no such file or directory, open '/Users/az/project1/node_modules/react-ionicons/lib/WomanOutline.js.map'

WARNING in ./node_modules/react-ionicons/lib/index.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/Users/az/project1/node_modules/react-ionicons/lib//WomanSharp.js.map' file: Error: ENOENT: no such file or directory, open '/Users/az/project1/node_modules/react-ionicons/lib//WomanSharp.js.map'

WARNING in ./node_modules/react-ionicons/lib/index.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/Users/az/project1/node_modules/react-ionicons/lib/index.js.map' file: Error: ENOENT: no such file or directory, open '/Users/az/project1/node_modules/react-ionicons/lib/index.js.map'

webpack compiled with 1302 warnings

Is that mean I did not install react-ionicons correctly ?

1

There are 1 best solutions below

1
Andy React On

I have found the fix by the link below [blog]: Failed to parse source map... Error: ENOENT: no such file or directory

Create the file .env in the project folder and type the key

GENERATE_SOURCEMAP=false