Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/raulfdm/sveltekit-vite-ssr-error
https://github.com/raulfdm/sveltekit-vite-ssr-error
Last synced: 16 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/raulfdm/sveltekit-vite-ssr-error
- Owner: raulfdm
- Created: 2021-07-19T17:06:24.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2021-07-21T05:36:56.000Z (over 3 years ago)
- Last Synced: 2024-05-14T00:44:01.975Z (6 months ago)
- Language: JavaScript
- Size: 32.2 KB
- Stars: 1
- Watchers: 3
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Sveltekit + Vite: ReferenceError: module is not defined
This repository is meant to reproduce a problem when we add a dependency without the node builtins.
```
[vite] Error when evaluating SSR module /node_modules/is-buffer/index.js:
ReferenceError: module is not defined
at /node_modules/is-buffer/index.js:8:1
at instantiateModule (/Users/raul_personal/development/unified-sveltekit/node_modules/vite/dist/node/chunks/dep-11db14da.js:73323:166)
```## Details
I'm currently trying to use `unified` (and later combine with `remark-parse`) to perform from some markdown string -> html client side, pretty much like [`react-markdown`](https://github.com/remarkjs/react-markdown) and many other library does.
However, when I try to import `unified` client side in Sveltekit it throws `ReferenceError: module is not defined`.
I assume it's because `unified` doesn't ship the node builtins and `vite` also doesn't include them by default.
## Repro
1. Clone this project
2. npm/yarn install
3. npm/yarn dev
4. Access [http://localhost:3000](http://localhost:3000)