Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/pngwn/kit-prism-ssr-bug


https://github.com/pngwn/kit-prism-ssr-bug

Last synced: about 1 month ago
JSON representation

Awesome Lists containing this project

README

        

# kit-pirms-ssr-bug

Repro for a bug: https://github.com/pngwn/prism-svelte/issues/11

## run it

```bash
pnpm i
pnpm dev
```

Navigate to `http://localhost:3000`.

When loading a page this produces:

```
Cannot read property 'highlight' of undefined
```

Because `Prism` is undefined.

This works:

```bash
pnpm build
pnpm preview
```

Navigate to `http://localhost:3000`.

No problem, everything highlighted.

## why?

No idea. It will be something to with PrismJS's UMD output (attaching itself to the global namespace) and the way vite bundles for dev.