Hi!
I am experiencing a persistent build issue when trying to publish my application. The build process fails with a “Module not found” error, but the error message is inconsistent with the actual content of the source files. This strongly suggests a server-side build cache issue.
The Problem:
The build log reports the following error:
Module not found: Can't resolve './logo' in /workspace/src/components/medicoach/patient-selection.tsx
However, the file patient-selection.tsx does not contain this relative import. It correctly uses an alias import, as shown here: import { Logo } from '@/components/core/logo';
The build process seems to be using an incorrect version of the file from its cache, rather than the current, correct version in my workspace.
Troubleshooting Steps Taken:
I have already attempted all standard methods to clear the cache, with no success:
-
Deleted the
.nextdirectory: Manually removed the entire.nextdirectory from the workspace. The error persisted on the next publish attempt. -
Modified
package.json: Changed a dependency version to force a full re-install and build. The error persisted. -
Modified
tsconfig.json: Altered compiler options to try and invalidate the build cache. The error persisted.
Does anyone have any other suggestions?
Regards
Jonas