I'm dealing with a very weird issue. For some reason, since a few days, my application doesn't seem to be loading JSON files anymore inside modules.
The app was created with create-react-app, and has been in development for a while without any issues. I've had a dependency in the project (world-countries) that basically only exports a json file. This dependency is not a recent addition.
So, here's the thing. From one day to another, I get the following error while starting/building the app:
Module not found: Error: Cannot resolve module 'json' in /Users/…
As far as I know, I made no changes that would result in this, and create-react-app's webpack version is still the same.
Another dependency that also used a json file internally also had this issue, but I managed to circumvent that.
I've explicitly installed json-loader in case something with webpack got messed up, but this didn't make any difference. In fact, I find it curious that _the missing dependency is "json" and not json-loader.
Requiring a random JSON file in the root of my app goes well, somehow this odd behaviour only seems to apply to json files within node_modules in the app.
By this point, I have reinstalled dependencies and node.js multiple times, checked file permissions, etc. To no avail.
I'm still quite perplexed, and have no idea what the issue might be. Any suggestions on how to fix this are very welcome
via Marco
No comments:
Post a Comment