Docker (specifically docker compose) did not recognize changes in the package.json file as something that would trigger the recreation of the node_modules directory in the specified volume. As a result, when running docker compose up, the existing volume containing the node_modules directory was used, which did not include newly added dependencies. This caused the app to fail when attempting to import those dependencies, getting a Module not recognized error.
Temporary Solution
We manually deleted the volume containing the node_modules directory, then rebuilt the frontend Docker image. This forced Docker to recreate the volume, which correctly included the new dependency added to package.json.
The concern is that we should not have to manually delete the volume to solve this
Issue encountered:
docker compose
) did not recognize changes in thepackage.json
file as something that would trigger the recreation of thenode_modules
directory in the specified volume. As a result, when runningdocker compose up,
the existing volume containing thenode_modules
directory was used, which did not include newly added dependencies. This caused the app to fail when attempting to import those dependencies, getting aModule not recognized
error.Temporary Solution
node_modules
directory, then rebuilt the frontend Docker image. This forced Docker to recreate the volume, which correctly included the new dependency added topackage.json
.The concern is that we should not have to manually delete the volume to solve this