Given a Go function called /api/[...path].go
, all requests like /api/login
, /api/user
, etc. are routed correctly and handled by the function.
Alas, all routes three levels deep (/api/user/verify
, /api/shizzle/{id}
) instantly return a 404. They do not even show up in the logs.
In that regard, it looks like the platform handles Go functions with a wildcard name [...path]
as if it was named just [path]
.
This looks like a bug to me.
system
(system)
June 20, 2025, 6:38am
2
There’s another community post with 404 debugging tips that might be helpful. Please give these solutions a try and let us know how it goes.
Sometimes things don’t go as expected when deploying a website. If you see a 404 on your site, that means the page or resource couldn’t be found.
There are many possible causes, and the absence of something can be tricky debug if you don’t know where to look. Here are some things you can do to find the cause and fix it.
Debugging Tips
Check the error code
If you see a mostly white screen with 404: NOT_FOUND along with a Code and and ID then you can click the blue info box below the error deta…
A human should be around soon to offer more advice. But you can also get helpful information quickly by asking v0 .
Thanks for reporting, I can reproduce this. I’ll share this internally
Thanks @jacobparis , please keep me updated about the status of this issue!
Hey @jacobparis , any update on this? Is there any known workaround we can use for the time being? Would a custom Docker-based runtime or something like this work?
Oh my, the solution is simply to use rewrites .
In my case, it was as simple as just renaming the function handler to /api/index.go
and configuring this in vercel.json
:
{
"rewrites": [
{
"source": "/api/(.*)",
"destination": "/api/index.go"
}
]
}
Alas, the documentation is not very clear about this. I did not expect to be able to specify the filename of a function as destination, but apparently this works and the request still contains the originally requested path, so the request handler can correcly dispatch based on it.
system
(system)
Closed
July 8, 2025, 8:01pm
9
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.