-
Notifications
You must be signed in to change notification settings - Fork 33
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
Svelte 5 support #15
Comments
I haven't looked into Svelte 5 yet, so not sure if there's an alternative way of rendering the component. Will look into this when I'm able! |
Seems like the link in that error message (https://svelte-5-preview.vercel.app/docs/breaking-changes#components-are-no-longer-classes) has some alternatives. Feel free to try them out! I'm currently on vacation so won't be able to look into this for a bit |
Yeah so in order to work for Svelte 5 there is a need to do an adjustment in $lib/utils + import { render } from 'svelte/server';
//...
// - export const importPosts = (render = false ) => {
export const importPosts = () => {
const blogImports = import.meta.glob('$routes/*/*/*.md', { eager: true });
const innerImports = import.meta.glob('$routes/*/*/*/*.md', { eager: true });
const imports = { ...blogImports, ...innerImports };
const posts: BlogPost[] = [];
for (const path in imports) {
const post = imports[path];
if (post) {
posts.push({
...post.metadata,
// html: render && post.default.render ? post.default.render()?.html : undefined,
+ html: render && post.default ? render(post.default)?.html : undefined,
});
}
}
return posts;
} |
So I had updated to svelte5 and the setup breaks with following error when parsing .md files with mdsvex
it appears only when i try to visit .md blog post site. Any quick fix possible to make it work under Svelte5 ?
my svelte.config.js:
The text was updated successfully, but these errors were encountered: