I have a ipAddress.json file that has the contents:
{
"ipAddress": "11.111.111.111"
}
In the public folder i put that ipAddress.json file into an "ipAddress" folder so the path looks like "public/ipAddress/ipAddress.json"
But I cannot read this file. I am trying
const ipAddress = (require(process.env.PUBLIC_URL + '/ipAddress/ipAddress.json')).ipAddress;
using "json-loader" common library.
How do I get this to work? According to (Using the Public Folder) it should work just fine.
But I get this error:
Module not found: You attempted to import /ipAddress/ipAddress.json which falls outside of the project src/ directory. Relative imports outside of src/ are not supported.
Thank you for any help