I am using create-react-app. I am trying to call an image from my public folder from a file inside my src/components
. I am receiving this error message.
You don't need to eject, you can modify the react-scripts
config with the rescripts library
This would work then:
module.exports = config => {
const scopePluginIndex = config.resolve.plugins.findIndex(
({ constructor }) => constructor && constructor.name === "ModuleScopePlugin"
);
config.resolve.plugins.splice(scopePluginIndex, 1);
return config;
};