I am using parcel V2.7.1 so that i can interact my frontend script with my backend express app. I imported axios
which is an npm package, but anytime i but anytime i run parcel and build I get and error message on the browser console stated Uncaught referenceError: require is not defined
. I checked my bundle.js file and i find some lines with the require
keyword. In summary anytime there is a require
keyword in my main bundle file (bundle.js) due to an npm package import from my source file (index.js) i get the error Uncaught referenceError: require not defined
.
I set "browserslist": "> 0.25%
But am not sure if that even affected anything
I also set "engines": { "browsers":"> 0.25% }
Please what can i do now cause am out of options.. i have read through the parcel.js documentation but nothing to help me