Nam
Next.js - "Cannot find module 'x'... " ONLY during build stage
Hi all,
I have a Next.js yarn monolith project. I'm trying to deploy on Railway.
The error I'm keep getting on Railway:
Type error: Cannot find module 'pdf-lib' or its corresponding type declarations.
I cannot reproduce this locally when I run yarn install
and yarn build
.
We will appreciate it immensely if you can help us, thanks!
More context:
We have 2 repos - cronjob and web app, both are Next.js. Recently migrated all of our cronjob code into our web app code for monolith.
We have the same app deployed on both Vercel and Railway, and we just wanna use the Railway instance for the purpose of cronjobs.
Project id: 00312f09-a0bd-4217-95e0-9f6fbe84ae264 replies