ijavad805 / ijavad805/react-datepicker

ReferenceError: require is not defined in production mode (dev mode works fine!)

Open
#22 4 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
38
Forks
6
PR merge metrics
No merged PRs in 30d

Description

Hi there.
i have an issue with your package, it works perfectly fine on development mode, but in the build there is an error:
ReferenceError: require is not defined
image
image

im using:
package manager: yarn
build tool: Vite

System:
OS: Windows 11 10.0.22621
CPU: (8) x64 Intel(R) Core(TM) i3-10100 CPU @ 3.60GHz
Memory: 2.35 GB / 7.82 GB
Binaries:
Node: 18.18.1 - C:\Program Files\nodejs\node.EXE
Yarn: 1.22.19 - ~\AppData\Roaming\npm\yarn.CMD
npm: 10.2.0 - C:\Program Files\nodejs\npm.CMD
Browsers:
Edge: Spartan (44.22621.2283.0), Chromium (120.0.2210.91)
Internet Explorer: 11.0.22621.1
npmPackages:
vite: ^4.0.0 => 4.5.0

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No source files or tests are named. First reproduce a production build with Vite using the reported setup, then inspect the generated bundle and package entry points for the browser-side require reference; done means the production build runs without the ReferenceError.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript, vite
Domain
build-system, frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.