vercel / platforms

A full-stack Next.js app with multi-tenancy and custom domain support. Built with Next.js App Router and the Vercel Domains API.
https://app.vercel.pub
5.38k stars 689 forks source link

Deploys of this template only respond with 404 #324

Closed jesper-bylund closed 9 months ago

jesper-bylund commented 9 months ago

Following the official guide (https://vercel.com/blog/platforms-starter-kit) and deploying the template (https://vercel.com/templates/next.js/platforms-starter-kit) only starts a service that responds 404 to each request without any errors or logs to debug.

It works locally. Just not on vercel as a host.

There are many issues and discussions, all unanswered for weeks or months. Is this project abandoned? Is it supposed to work? How can we debug the 404 error? 🤔

jesper-bylund commented 9 months ago

ping @rauchg

jesper-bylund commented 9 months ago

I hope my tone isn't harsh here. I'm excited about this template and would love to use it, which is why the apparent wall of silence is frustrating. 🙏

jesper-bylund commented 9 months ago

ping @steven-tey, who seems to have been the primary contributor to this repo?

steven-tey commented 9 months ago

Just merged #323 which should fix this issue! Anyone still facing this problem?

jesper-bylund commented 9 months ago

@steven-tey that didn't solve anything. 🤔 Literally no difference. How did you test that? My deployed version still only shows 404. both on root.tld and app.root.tld

jesper-bylund commented 9 months ago

So thanks to your update I realised I could use middleware.ts to debug what was happening. It turns out that NEXT_PUBLIC_ROOT_DOMAIN has to be an exact match with with the variable hostname.

This caused issues for me because my NEXT_PUBLIC_ROOT_DOMAIN was using the protocol prefix https:// 😅

This is a fragile setup. There's quite a few tiny things that you need to get exactly right about the wildcard domain and the variable setup that could be better documented.

TlDr; My NEXT_PUBLIC_ROOT_DOMAIN was https://note.fish and my hostname was note.fish. This caused infinite 404s.

Neosprings commented 8 months ago

I guess I'm running into this issue as well. Any better documentation on how to get past the 404 mainpage?