Closed selfagency closed 2 months ago
Welp, I figured it out and it was really dumb. You must add an options object to the invocation in svelte.config.js
even if you don't use it.
import { vitePreprocess } from '@sveltejs/vite-plugin-svelte';
import postcssConfig from 'postcss-load-config';
import adapter from 'sveltekit-adapter-iis';
/** @type {import('@sveltejs/kit').Config} */
const config = {
preprocess: [
vitePreprocess({
postcss: true,
postcssConfig,
}),
],
kit: {
adapter: adapter({}), // <------------
csp: {
directives: {
// 'script-src': ['self', 'unsafe-eval', 'https://unpkg.com'],
},
},
csrf: {
checkOrigin: false,
},
},
};
export default config;
You'll most likely find yourself needing to add adapter options either way if you want things like form actions or logging to work.
@ablesea i'm struggling with exposing my websocket server
Not something that I have tried to do on IIS before nor with SvelteKit unfortunately
@ablesea Now I'm trying to use http-proxy-middleware and it's running great in Vite but not at all once built with the adapter, returning blank pages instead of passing through connections to my API server. I would very much appreciate your help with that.
hooks.server.ts
const apiProxy = createProxyMiddleware({
target: PUBLIC_API_ENDPOINT,
changeOrigin: true,
});
Using v1.2.5, getting this error whether building in Windows 11, Ubuntu 20, or MacOS 12.
Full Ubuntu build output:
debug: