I have a simple sveltekit project where I need to link to resources not handled by sveltekit.
Therefore I needed to pass "strict: false" to svelte static adapter.
I also wanted to use a second adapter to crate a neutralino's app.
import staticAdapter from '@sveltejs/adapter-static';
/** @type {import('@sveltejs/kit').Config} */
const config = {
kit: {
adapter: staticAdapter({
strict: false,
pages: 'build/static',
assets: 'build/static',
fallback: 'index.html',
precompress: false
})
}
};
export default config;
import staticAdapter from '@sveltejs/adapter-static';
import multiAdapter from '@macfja/svelte-multi-adapter';
/** @type {import('@sveltejs/kit').Config} */
const config = {
kit: {
adapter: multiAdapter([
staticAdapter({
strict: false,
pages: 'build/static',
assets: 'build/static',
fallback: 'index.html',
precompress: false
})
])
}
};
export default config;
@sveltejs/adapter-static: all routes must be fully prerenderable, but found the following routes that are dynamic:
[...]
You have the following options:
- set the `fallback` option โ see https://kit.svelte.dev/docs/single-page-apps#usage for more info.
- add `export const prerender = true` to your root `+layout.js/.ts` or `+layout.server.js/.ts` file. This will try to prerender all pages.
- add `export const prerender = true` to any `+server.js/ts` files that are not fetched by page `load` functions.
- pass `strict: false` to `adapter-static` to ignore this error. Only do this if you are sure you don't need the routes in question in your final app, as they will be unavailable. See https://github.com/sveltejs/kit/tree/master/packages/adapter-static#strict for more info.
"devDependencies": {
"@aleritty/svelte-adapter-neutralino": "git+https://github.com/aleritty/svelte-adapter-neutralino.git",
"@fortawesome/svelte-fontawesome": "^0.2.0",
"@macfja/svelte-multi-adapter": "^1.0.2",
"@sveltejs/adapter-static": "^2.0.2",
"@sveltejs/kit": "^1.20.2",
"@typescript-eslint/eslint-plugin": "^5.59.11",
"@typescript-eslint/parser": "^5.59.11",
"autoprefixer": "^10.4.14",
"daisyui": "^3.1.0",
"eslint": "^8.42.0",
"eslint-config-prettier": "^8.8.0",
"eslint-plugin-svelte": "^2.30.0",
"eslint-plugin-svelte3": "^4.0.0",
"postcss-load-config": "^4.0.1",
"prettier": "^2.8.8",
"prettier-plugin-svelte": "^2.10.1",
"sass": "^1.63.4",
"svelte": "^3.59.1",
"svelte-check": "^3.4.3",
"svelte-i18n": "^3.6.0",
"svelte-notifications": "^0.9.98",
"svelte-preprocess": "^5.0.4",
"tailwindcss": "^3.3.2",
"tslib": "^2.5.3",
"typescript": "^5.1.3",
"vite": "^4.3.9"
},
I'm not sure what can be the cause.