Gossamer Winchell
Gossamer Winchell

Reputation: 21

Vercel host: Next.js site not serving my static files

I've built out a new site in Next.js and have deployed it on vercel.com (their free Hobby plan). Everything works except that I built out some sample pages and put them into /public (as instructed by the Nextjs docs) so I have a directory structure as follows: /public/demo/gencenter/gencenter.html which I'm expecting to be visible on https://cfsnap.com/demo/gencenter/gencenter.html but I'm getting a 404 (the console reports "failed to load resource.... 404")

Anyone know if a Next.js has any handles I should jiggle to make static files load? For giggles I put a few image files in the /public directory and I can call them directly and they appear as expected: https://cfsnap.com/demo/gencenter/swimCalendar.png

I read about naming conflicts in the Next.js docs but "gencenter.html" is unique and doesn't exist anywhere else.

Any help would be greatly appreciated.

Rich

Upvotes: 1

Views: 2985

Answers (1)

Gossamer Winchell
Gossamer Winchell

Reputation: 21

Vercel uses clean urls, causing the file "index.html" to be renamed to "index". When I updated my internal links to point to "index" everything started working again. Only applies to html files apparently, CSS and image files remain unaffected.

https://vercel.com/docs/configuration#project/clean-urls

Upvotes: 1

Related Questions