Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pngwn/kit-prism-ssr-bug
https://github.com/pngwn/kit-prism-ssr-bug
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/pngwn/kit-prism-ssr-bug
- Owner: pngwn
- Created: 2021-07-10T12:08:27.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2021-07-10T12:12:37.000Z (over 3 years ago)
- Last Synced: 2024-10-13T13:04:56.469Z (2 months ago)
- Language: Svelte
- Size: 8.79 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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.