Cannot find module ‘X’ in a frontend build

The build tool could not resolve an import. Start with the full specifier and the workspace containing the importing file. The package may be missing there, or the import may point to a file or subpath the package does not export.
Check installed dependencies and the lockfile. If it is a local file, compare the path and capitalization with what is on disk. For a package subpath, check the exports field and use a supported entry point for the version your build installs.
A package import can work on a developer machine because that dependency is already installed there. Verify the same build in the environment that failed. A path can appear to work on a machine with case-insensitive filenames or an existing dependency tree and still fail on a clean CI runner.
// After installing a dependency in your project: import { format } from 'date-fns'; console.log(format(new Date(), 'yyyy-MM-dd'));
Run the deployment build with the workspace lockfile and compare the failing import’s capitalization with the actual filename.