2 months ago
I'm running a payloadcms project with a postgres db. My build process uses pnpm and railpack correctly determined that. I am not using docker.
Upon running pnpm run build, there are errors that a requested module is not found, despite it existing in the filesystem.
pnpm run build
41s
> porgunc@1.0.0 build /app
> cross-env NODE_OPTIONS=--no-deprecation next build
▲ Next.js 15.4.10
Creating an optimized production build ...
Failed to compile.
./src/payload.config.ts
Module not found: Can't resolve '@/collections/Files'
https://nextjs.org/docs/messages/module-not-found
Import trace for requested module:
./src/components/AcceptInvitationForm/actions.ts
./node_modules/.pnpm/next@15.4.10_@babel+core@7.28.6_@playwright+test@1.54.1_react-dom@19.2.3_react@19.2.3__react@19.2.3_sass@1.77.4/node_modules/next/dist/build/webpack/loaders/next-flight-action-entry-loader.js?actions=%5B%5B%22%2Fapp%2Fsrc%2Fcomponents%2FAcceptInvitationForm%2Factions.ts%22%2C%5B%7B%22id%22%3A%2240a6f52cf2784726bba3257a9b2986d413e21f7599%22%2C%22exportedName%22%3A%22acceptInvite%22%7D%5D%5D%5D&__client_imported__=true!
./src/payload.config.ts
Module not found: Can't resolve '@/collections/Files'
https://nextjs.org/docs/messages/module-not-found
Import trace for requested module:
./src/app/(frontend)/accept-invite/page.tsx
> Build failed because of webpack errors
ELIFECYCLE Command failed with exit code 1.
ERROR: failed to build: failed to solve: process "pnpm run build" did not complete successfully: exit code: 1
This same command works on my local system. Even if I remove any references to that specific file, I then get errors from my autogenerated migrations (lines like this: import * as migration_20260117_075704 from './20260117_075704';).
These files do exist in my git repo.
1 Replies
2 months ago
I moved my GitHub repo to an org, and railway stopped complaining after that. Not sure why that fixed it, but it did. Sorry if anyone else has the same issue.
Status changed to Solved brody • 2 months ago