pngwn / MDsveX

A markdown preprocessor for Svelte.
https://mdsvex.pngwn.io
MIT License
2.46k stars 103 forks source link

Svelte 5: Deprecation Warning: context="module" is deprecated, use the module attribute instead #649

Open ThomasPais opened 2 months ago

ThomasPais commented 2 months ago

Description:

I am encountering deprecation warnings when using Svelte 5. The warnings indicate that context="module" is deprecated and should be replaced with the module attribute svelte 5 preview documentation.

The warnings occur when the markdown files are loaded from the JSON: +page.server.ts

import type { Post } from '$lib/types';

export async function load({ fetch }) {
    const response = await fetch('api/blog');
    const posts: Post[] = await response.json();
    return { posts };
}

console

[vite-plugin-svelte] src/lib/blog/tenth-post.md:1:8 `context="module"` is deprecated, use the `module` attribute instead

Environment:

Svelte 5 Node.js > 20 MDsveX 0.12.3

Expected Behavior:

No deprecation warnings should appear if the correct attribute is used.

Actual Behavior:

Deprecation warnings appear for each instance of context="module".

pngwn commented 2 months ago

The warning is harmless but I'll fix it before the release of 5.0.

lts20050703 commented 2 weeks ago

@pngwn Svelte 5.0 is released, I know it's harmless, but it would be nice not to have console (and therefore CI) being spammed with the warning <3