question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

adapter static+endpoint / adapter static + refresh page

See original GitHub issue

Describe 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:closed
  • Created 2 years ago
  • Reactions:2
  • Comments:13 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
Conduitrycommented, Mar 10, 2022

#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.

1reaction
Rich-Harriscommented, Mar 10, 2022

Right, the behaviour changed. That’s why you saw this message:

You should set config.kit.prerender.default to true if no fallback is specified

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found