hello,
this is a really strange issue that I have and is 100% related to vercel.
basically, vercel doesnt want to build my website at all and is giving random type errors that are not showing on my pc, it’s like the wrong version of nextjs (since this is what my app uses) is used.
I tried everything, and I mean it, even tried to redeploy an old version that always worked and it also failed! with no code change the build failed, which is what makes it so weird
I doubt my config is needed here because as I said even when I don’t change anything and I redeploy an old version (that I repeat myself: always worked) it still errors out, just really tried to fix a typo and it resulted with a whole day of debugging
additionally, I do not have vercel.json and all config is automatically set by vercel, so I probably did nothing wrong.
on my local pc I tried to build the way possibly vercel does it, which is put it in a container and install + build everything from scratch with no caching, and it went alright.
also, I tried to fix the errors but it never ended, so after like 5 fixes I gave up since I really don’t want to waste my build hours
examples of errors include:
Type error: Module '"react-dom"' has no exported member 'useFormStatus'.
3 | import { Button } from "@/components/ui/button";
4 | import { Loader2 } from "lucide-react";
> 5 | import { useFormStatus } from "react-dom";
| ^
6 |
7 | export default function SubmitButton({ disabled, text }: { disabled?: boolean; text?: string }) {
8 | const { pending } = useFormStatus();
Type error: Type '(formData: any) => Promise<void>' is not assignable to type 'string'.
21 | <Form
22 | className="rounded-lg flex flex-col sm:flex-row w-full"
> 23 | action={async (formData) => {
| ^
24 | try {
25 | // check if the question is valid
26 | const checkRes = await checkQuestion(formData.get("query") as string);
Error: Command "next build" exited with 1
… and more
so any help will be appreciated, thanks!
edit: additionally it’s worth adding that I’m currently facing Adsense review process and need to react quickly to any errors they found on my site, especially since the app I’m building is related to this season and every day I’m losing people and potentially money just because of a bug that I can’t fix at all (and wasn’t even started by me)
so tl;dr the longer I wait the bigger loss it is
edit2: just to be clear I tried to build without the “build cache”, changed the node version, updated the build command and a lots of others still with no good result
at the time of writing my app isn’t functional because of a bug I found that I can’t fix