-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
adapter-static error: config.kit.adapter should be an object with an "adapt" method #645
Comments
Just to make sure you're using the latest, try changing https://github.com/stordahl/sveltekit-first-look/blob/bddd1dca3676b48f38cb506268603c0be0686589/package.json#L11 to just say |
Got the same error when starting the dev server |
It looks like you changed it to |
Got it, sorry about the confusion! Adapter is working now, thanks for the help @benmccann |
@benmccann I'm getting the same error and unfortunately the above steps don't seem to work for me. Here's my the branch I'm working on: What I'm seeing on the console after running
I've tried using ⬇ {
"name": "conference",
"version": "0.0.1",
"scripts": {
"dev": "svelte-kit dev",
"build": "svelte-kit build",
"start": "svelte-kit start",
"lint": "prettier --check . && eslint .",
"format": "prettier --write ."
},
"devDependencies": {
"@sveltejs/adapter-netlify": "next",
"@sveltejs/adapter-node": "next",
"@sveltejs/kit": "next",
"svelte": "^3.29.0",
"vite": "^2.1.0",
"typescript": "^4.0.0",
"tslib": "^2.0.0",
"svelte-preprocess": "^4.0.0",
"@typescript-eslint/eslint-plugin": "^4.19.0",
"@typescript-eslint/parser": "^4.19.0",
"eslint": "^7.22.0",
"eslint-plugin-svelte3": "^3.1.0",
"prettier": "~2.2.1",
"prettier-plugin-svelte": "^2.2.0",
"eslint-config-prettier": "^8.1.0"
},
"type": "module",
"engines": {
"node": ">= 12.17.0"
},
"dependencies": {
"dayjs": "^1.10.4",
"svelte-icons": "^2.1.0"
}
} ⬇ /* eslint-disable no-undef */
/* eslint-disable @typescript-eslint/no-var-requires */
const sveltePreprocess = require('svelte-preprocess');
const netlify = require('@sveltejs/adapter-netlify');
const node = require('@sveltejs/adapter-node');
const pkg = require('./package.json');
/** @type {import('@sveltejs/kit').Config} */
module.exports = {
// Consult https://github.com/sveltejs/svelte-preprocess
// for more information about preprocessors
preprocess: sveltePreprocess(),
kit: {
adapter: node(),
// hydrate the <div id="svelte"> element in src/app.html
target: '#svelte',
vite: {
ssr: {
noExternal: Object.keys(pkg.dependencies || {})
}
}
}
}; |
Update: I was able to get it to work one step further with /* eslint-disable no-undef */
/* eslint-disable @typescript-eslint/no-var-requires */
const sveltePreprocess = require('svelte-preprocess');
const netlify = require('@sveltejs/adapter-netlify');
const node = require('@sveltejs/adapter-node');
const pkg = require('./package.json');
const adapterNetlify = require('@sveltejs/adapter-netlify');
/** @type {import('@sveltejs/kit').Config} */
module.exports = {
// Consult https://github.com/sveltejs/svelte-preprocess
// for more information about preprocessors
preprocess: sveltePreprocess(),
kit: {
adapter: adapterNetlify(),
// hydrate the <div id="svelte"> element in src/app.html
target: '#svelte',
vite: {
ssr: {
noExternal: Object.keys(pkg.dependencies || {})
}
}
}
}; Now the console doesn't complain, but in the browser I get the following error:
This is the same error I'd gotten when first installing the template. I've tried deleting Is this related to the same issue? If not, I'm happy to make a new issue. |
After further testing an a few more commits I was able to get It seems like the above issue is mainly to do with the dev server, rather than the build process. I'm still get familiar with the open source process so please let me know if you'd rather these notes on a separate issue or anything. |
If the above steps don’t work for you (i.e., you change npm i @sveltejs/adapter-static@next And that should fix it. |
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
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:
Firefox Dev Edition 87.0b9 (64-bit)
Static adapter
Severity
Not severe, just trying to test SvelteKit out in static mode.
The text was updated successfully, but these errors were encountered: