Skip to content
Discussion options

You must be logged in to vote

Actually, I think I may have figured out what was going on. I got this to work within a SvelteKit page where my configuration is stored as a JS file, which is so I can change between using a real and test repo if I'm in dev or prod mode.

Basically, SSR needs to be disabled for that route so the entire thing is client-side rendered. Since server rendering does not have a window object, it was failing to attach to the page, but disabling it worked just fine.


Here’s how I did it.

/routes/(admin)/admin/+page.ts

export const ssr = false;

/routes/(admin)/admin/+page.svelte

<script lang="ts">
	import CMS from '@sveltia/cms';
    //CMS config exists in my lib as a JS file
	import { config } from '

Replies: 1 comment 6 replies

Comment options

You must be logged in to vote
6 replies
@Greenheart
Comment options

@kyoshino
Comment options

@Greenheart
Comment options

@Greenheart
Comment options

@vadimkantorov
Comment options

Answer selected by hammzj
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants