24

I want to use the @sveltejs/adapter-static in my Svelte Kit app (want to turn it into an SPA). I installed the adapter static with npm i @sveltejs/adapter-static.

The code in the svelte.config.cjs looks like this

kit: {
    // By default, `npm run build` will create a standard Node app.
    // You can create optimized builds for different platforms by
    // specifying a different adapter
    adapter: adapter({
        fallback: 'app.html'
    }),

When I start my app with npm run dev I get the following error: config.kit.adapter should be an object with an "adapt" method

How can I fix this?

Fugi
  • 466
  • 8
  • 18

1 Answers1

47

just install it with the following command:

npm i -D @sveltejs/adapter-static@next

credits goes to: https://github.com/GrygrFlzr

Trichter
  • 593
  • 6
  • 7
  • Thank you, this worked. I feel kinda dumb now haha :) – Fugi Apr 24 '21 at 17:50
  • hehe no problem ^^ @Fugi – Trichter Apr 24 '21 at 17:52
  • 3
    Did not work for me!! Is there any other workaround? – M B Parvez Jul 06 '21 at 21:47
  • @MBParvezRony not that I am aware of. You should ask on the Svelte Discord server. They have a pretty good response time and quality answers most of the time. – Trichter Jul 07 '21 at 10:44
  • how do i specify an output directory? – chovy Mar 21 '22 at 16:43
  • using @next just introduces whatever other bugs the next version brings! Technically it solves this issue, but it also brings a firehose of problems – Jan Apr 06 '22 at 10:52
  • @Jan this should be known since SvelteKit is still in development. You can see https://github.com/sveltejs/kit/milestones for further information on the progress of SvelteKit towards version 1.0. – Trichter Apr 06 '22 at 11:57