Closed wbhob closed 8 months ago
The sveltekit example works for me – both dev and building using the node adapter. It's using SvelteKit v2.
it appears that at one point, 'svelte-highlight/styles' was a valid import, but now it is not, so that was a major breaking change labeled as a patch release. I've updated the code to import the specific stylesheet and it's now working
I'll take a look.
@wbhob Thank you for flagging this.
Technically, it wasn't a breaking change as the barrel export files still exist (e.g., svelte-highlight/styles/index.js
). The bug was that the exports
map did not account for these entry points.
I published a fix in v7.4.8, which supports additional import methods:
// Base import for styles/languages
import { _default } from "svelte-highlight/styles";
import { _1c } from "svelte-highlight/languages";
// Explicit index
import { _default } from "svelte-highlight/styles/index";
import { typescript } from "svelte-highlight/languages/index";
// Explicit extension
import lang from "svelte-highlight/languages/1c.js"
import style from "svelte-highlight/styles/3024.js";
No TS errors in my IDE; Vite was able to resolve these imports in vite dev
and vite build
.
When attempting to build my app using SvelteKit 2.0 and Vite 5.0, the following error occurs. The last version that builds successfully is 7.4.2.