Svelte returning unexpected option for prerender

Viewed 17

Whenever I try to build my Svelte site, I get this error in the console:

Unexpected option config.kit.prerender.default

If you're curious how I'm building, I'm running the command npm run build

The file hierarchy is:

lib > *.svelte
routes > *.svelte
app.html
global.d.ts
stores.js
static > images and stuff

I'm trying to get true HTML pages for this website to be hosted easily. Here's my config.

import preprocess from "svelte-preprocess";
//import adapter from "@sveltejs/adapter-auto";
import adapter from '@sveltejs/adapter-static';

/** @type {import('@sveltejs/kit').Config} */
const config = {
  kit: {
    adapter: adapter({
      // default options are shown
      pages: 'build',
      assets: 'build',
      fallback: null
    }),
    prerender: {
      // This can be false if you're using a fallback (i.e. SPA mode)
      default: true
    }
  },

  preprocess: [
    preprocess({
      postcss: true,
    }),
  ],
};

export default config;

Also, my package.json. I am pretty sure I have everything I need for this to work.

{
  "name": "serpent-website",
  "homepage": "https://serpentclient.app",
  "version": "0.0.1",
  "scripts": {
    "dev": "svelte-kit dev",
    "build": "svelte-kit build",
    "preview": "svelte-kit preview",
    "check": "svelte-check --tsconfig ./tsconfig.json",
    "check:watch": "svelte-check --tsconfig ./tsconfig.json --watch",
    "lint": "prettier --ignore-path .gitignore  --check --plugin-search-dir=. . && eslint --ignore-path .gitignore .",
    "format": "prettier --ignore-path .gitignore --write --plugin-search-dir=. ."
  },
  "devDependencies": {
    "@sveltejs/adapter-static": "^1.0.0-next.43",
    "@sveltejs/adapter-vercel": "next",
    "@sveltejs/kit": "next",
    "@typescript-eslint/eslint-plugin": "^5.38.0",
    "@typescript-eslint/parser": "^5.38.0",
    "eslint": "^8.24.0",
    "eslint-config-prettier": "^8.5.0",
    "eslint-plugin-svelte3": "^4.0.0",
    "prettier": "~2.7.1",
    "prettier-plugin-svelte": "^2.7.0",
    "svelte": "^3.50.1",
    "svelte-check": "^2.9.0",
    "svelte-preprocess": "^4.10.7",
    "tslib": "^2.4.0",
    "typescript": "^4.8.3"
  },
  "type": "module",
  "dependencies": {
    "svelte-scrollto": "^0.2.0",
    "svelte-seo": "^1.4.1"
  }
}

1 Answers

The documentation for the current version does not list a default property, as noted by the error:

prerender: {
  concurrency: 1,
  crawl: true,
  enabled: true,
  entries: ['*'],
  onError: 'fail',
  origin: 'http://sveltekit-prerender'
},

Docs

Related