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 error: config.kit.adapter should be an object with an "adapt" method

See original GitHub issue

Describe the bug Just spun up a project following the docs. I installed the static adapter and tried to modify svelte.config.cjs to use the static adapter but the server wont spin up. App otherwise runs with the node adapter.

Logs

> sveltekit-first-look@0.0.1 dev
> svelte-kit dev "--open"

config.kit.adapter should be an object with an "adapt" method. See https://kit.svelte.dev/docs#adapters
Error: config.kit.adapter should be an object with an "adapt" method. See https://kit.svelte.dev/docs#adapters
    at Object.validate (file:///Users/stordahl/Code/sveltekit-first-look/node_modules/@sveltejs/kit/dist/cli.js:162:13)
    at validate (file:///Users/stordahl/Code/sveltekit-first-look/node_modules/@sveltejs/kit/dist/cli.js:341:28)
    at validate (file:///Users/stordahl/Code/sveltekit-first-look/node_modules/@sveltejs/kit/dist/cli.js:339:19)
    at validate_config (file:///Users/stordahl/Code/sveltekit-first-look/node_modules/@sveltejs/kit/dist/cli.js:402:20)
    at load_config (file:///Users/stordahl/Code/sveltekit-first-look/node_modules/@sveltejs/kit/dist/cli.js:381:20)
    at async get_config (file:///Users/stordahl/Code/sveltekit-first-look/node_modules/@sveltejs/kit/dist/cli.js:431:10)
    at async file:///Users/stordahl/Code/sveltekit-first-look/node_modules/@sveltejs/kit/dist/cli.js:474:18

To Reproduce I have made sure all pkgs are up to date. Project is in remote here

Expected behavior Just expecting the server to spin up with the static-adapter installed

Stacktraces If you have a stack trace to include, we recommend putting inside a <details> block for the sake of the thread’s readability:

Stack trace

Stack trace goes here…

Information about your SvelteKit Installation:

System:
    OS: macOS 10.15.7
    CPU: (4) x64 Intel(R) Core(TM) i5-5257U CPU @ 2.70GHz
    Memory: 56.84 MB / 8.00 GB
    Shell: 3.2.57 - /bin/bash
  Binaries:
    Node: 15.11.0 - /usr/local/bin/node
    npm: 7.6.0 - /usr/local/bin/npm
  Browsers:
    Chrome: 89.0.4389.90
    Firefox Developer Edition: 87.0
    Safari: 13.1.3
  npmPackages:
    @sveltejs/kit: next => 1.0.0-next.58 
    svelte: ^3.29.0 => 3.35.0 
  • Firefox Dev Edition 87.0b9 (64-bit)

  • Static adapter

Severity Not severe, just trying to test SvelteKit out in static mode.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

8reactions
aralcommented, Apr 5, 2021

If the above steps don’t work for you (i.e., you change ^1.0.0-next to next and npm i and still get the same error with adapter-static), explicitly run:

npm i @sveltejs/adapter-static@next

And that should fix it.

2reactions
benmccanncommented, Mar 24, 2021

It looks like you changed it to ^1.0.0-next. Can you change it to literally just next like the other @sveltejs packages in package.json?

Read more comments on GitHub >

github_iconTop Results From Across the Web

config.kit.adapter should be an object with an "adapt" method
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 ......
Read more >
config.kit.adapter should be an object with an "adapt" method. See ...
This could be happening if you install the adapter with npm i -D @sveltejs/adapter-static as the version marked at latest on npm is...
Read more >
Adapters • Docs • SvelteKit
Adapters are small plugins that take the built app as input and generate output for deployment.
Read more >
Challenges with deploying to netlify - Developing with Prismic
I am unable to build locally with the static adapter, I have to use the node adapter. config.kit.adapter should be an object with...
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 >

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