Require is not defined - react-datepicker.min.js
See original GitHub issueFresh install, typical React project:
npm install react-datepicker --save
import DatePicker from 'react-datepicker';
Pages crashes with
react-datepicker.min.js?1928:1 Uncaught ReferenceError: require is not defined
Issue Analytics
- State:
- Created 8 years ago
- Comments:9 (2 by maintainers)
Top Results From Across the Web
reactjs - React-DatePicker - Format not Defined - Stack Overflow
I would take a look to see if that's the format function you would want to use or write your own format function...
Read more >react-datepicker - npm
A simple and reusable datepicker component for React. Latest version: 4.8.0, last published: 7 months ago. Start using react-datepicker in ...
Read more >Integrating with Other Libraries - React
It determines updates based on its own internal representation, and if the same DOM nodes are manipulated by another library, React gets confused...
Read more >Datepicker is not defined as function - CodeProject
In the browser, check the developer tools window and see if the bootstrap-datetimepicker.min.js file is actually being found and loaded.
Read more >Top 5 react-datepicker Code Examples - Snyk
css'; // tslint:disable-next-line:no-var-requires // const data = require('../data/style.json'); // tslint:disable-next-line:no-var-requires const DatePicker = ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Webpack usually has the configuration:
so the file
react-datepicker/dist/react-datepicker.min.js
is not being parsed. This file uses therequire
function which is NodeJS specific function.use
import DatePicker from 'react-datepicker/dist/react-datepicker';