https://github.com/blimmer/show-vite-issue
https://github.com/blimmer/show-vite-issue
Last synced: 9 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/blimmer/show-vite-issue
- Owner: blimmer
- Created: 2021-05-13T20:09:54.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2021-05-13T20:10:01.000Z (about 5 years ago)
- Last Synced: 2025-07-29T11:55:36.619Z (11 months ago)
- Language: TypeScript
- Size: 21.5 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Vite `require is not defined` Issue Repro
This repository is a reproduction case for vite issue [todo]().
To reproduce:
1. Clone this repo.
1. Install dependencies (`npm ci`)
1. Start vite (`npm run dev`)

You'll see the following error in the console:
```
Uncaught ReferenceError: require is not defined
js entry.js:8
__require chunk-L26DXZYY.js:12
react-date-picker:1
```
The require in question is a `css` import from the `react-date-picker` library:
```
require("react-calendar/dist/Calendar.css");
```
Indeed, this isn't getting rewritten by the vite process.