adapter static+endpoint / adapter static + refresh page
See original GitHub issueDescribe the bug
after last npm update after run build everythink is ok on npm run preview but if if deploy my site on hosting and refresh any not main page i got 403/404
also i need POST method on my form with endpoint and after run build on run preview its ok, but after deploy i got 404 on my index.json.js, index.js, api/, api/index.json etc have no idea what to do help pls
Reproduction
npm init svelte@next my-app // select test app cd my-app npm install npm run dev – --open npm i @sveltejs/adapter-static change adapter on svelteconfig npm run build npm run preview - everythink is ok deploy on host - cant refresh pages and not todo app
Logs
No response
System Info
any, any, any
Severity
blocking all usage of SvelteKit
Additional Information
No response
Issue Analytics
- State:
- Created 2 years ago
- Reactions:2
- Comments:13 (5 by maintainers)
Top Results From Across the Web
@sveltejs/adapter-static - npm
Adapter for SvelteKit apps that prerenders your entire site as a collection of static files. If you'd like to prerender only some pages, ......
Read more >What and why: static-adapter : r/sveltejs - Reddit
My app uses routes and endpoints. With a static-adapter, all the JS is compiled(that never changes), and the HTML is pre-generated where ...
Read more >Adapters • Docs • SvelteKit
Most adapters will generate static HTML for any prerenderable pages of your site. In some cases, your entire app might be prerenderable, in...
Read more >@sveltejs/adapter-static | Yarn - Package Manager
Adapter for SvelteKit apps that prerenders your entire site as a collection of static files. If you'd like to prerender only some pages,...
Read more >SvelteKit.next Static Site Adapter Pages Return 404 on Refresh
I found the same situation, I found out that I should put a line in src/routes/+layout.js export const trailingSlash = 'always'.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

#4287 has been opened to have a more helpful build-time message about using the static adapter with a dynamic app, so I’m closing this issue.
It’s hard to pick through all the other unrelated discussions that was happening here, but it sounded to me like it was usage questions, and not reproducible bugs.
Right, the behaviour changed. That’s why you saw this message: