Closed Nfinished closed 2 years ago
It appears to be a useMutation
hook in a descendant causing the problem, Vercel won't build with this snippet.
const [createProjectMutation, { isLoading: isSubmitting }] = useMutation(
createProject,
{
onSuccess: () => {
onClose()
invalidateQuery(getProjects)
},
}
)
@Nfinished How did you resolve the issue? Is there a resolution other than removing that snippet?
Turned out it was actually a project dependency that was doing something vercel didn't like. My issue was unrelated to blitz
What was the dependency? @Nfinished ? These issues show up in Google and I'm having the same problem. It's always good to explain what it was and how you fixed it.
I see, I actually had a similar issue with randomizing. The shuffle was happening server side, but on every render it was refetching. I had to set 'refetchOnMount: false' in the useQuery config. I went ahead and did that for all the refetch options.
this is definitely still an issue, and I ran into this while using nanoid
in my mutation. I have 0 idea how that would be the reason for this error. Took almost 2 days to figure out. using uniqid
instead of nanoId
seems to have fixed the issue
What is the problem?
As posted here: https://github.com/vercel/vercel/discussions/7185, Vercel builds are failing with error
Build optimization failed: found pages without a React Component as default export
. I'd create an issue in Vercel/nextjs but as this is a Blitz project I'd definitely get bounced back here.Builds complete locally, but during Vercel deployments the above error occurs. Below is one of the relevant pages in its entirety, it's definitely default exporting a React component. Could this be due to some Blitz-specific step of the build process?
Paste all your error logs here:
(Vercel deployment logs)
Paste all relevant code snippets here:
What are detailed steps to reproduce this?
1.
Run
blitz -v
and paste the output here:Please include below any other applicable logs and screenshots that show your problem:
No response