You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This happens because create-react-app doesn't support *.cjs files. So require('date-fns') returns a string (more specifically, a URL to a *.cjs file), instead of a JS module object. Hence the error.
i get the error while using DateRange in react
Uncaught runtime errors:
ERROR
_dateFns.addYears is not a function
./node_modules/react-date-range/dist/components/Calendar/index.js@http://localhost:3000/static/js/bundle.js:27976:34
options.factory@http://localhost:3000/static/js/bundle.js:62455:31
webpack_require@http://localhost:3000/static/js/bundle.js:61907:32
fn@http://localhost:3000/static/js/bundle.js:62114:21
./node_modules/react-date-range/dist/components/DateRange/index.js@http://localhost:3000/static/js/bundle.js:28263:40
options.factory@http://localhost:3000/static/js/bundle.js:62455:31
webpack_require@http://localhost:3000/static/js/bundle.js:61907:32
fn@http://localhost:3000/static/js/bundle.js:62114:21
./node_modules/react-date-range/dist/index.js@http://localhost:3000/static/js/bundle.js:29632:41
options.factory@http://localhost:3000/static/js/bundle.js:62455:31
webpack_require@http://localhost:3000/static/js/bundle.js:61907:32
fn@http://localhost:3000/static/js/bundle.js:62114:21
./src/components/header/Header.jsx@http://localhost:3000/static/js/bundle.js:60871:93
options.factory@http://localhost:3000/static/js/bundle.js:62455:31
webpack_require@http://localhost:3000/static/js/bundle.js:61907:32
fn@http://localhost:3000/static/js/bundle.js:62114:21
./src/pages/home/Home.jsx@http://localhost:3000/static/js/bundle.js:61572:102
options.factory@http://localhost:3000/static/js/bundle.js:62455:31
webpack_require@http://localhost:3000/static/js/bundle.js:61907:32
fn@http://localhost:3000/static/js/bundle.js:62114:21
./src/App.js@http://localhost:3000/static/js/bundle.js:60755:93
options.factory@http://localhost:3000/static/js/bundle.js:62455:31
webpack_require@http://localhost:3000/static/js/bundle.js:61907:32
fn@http://localhost:3000/static/js/bundle.js:62114:21
./src/index.js@http://localhost:3000/static/js/bundle.js:61501:81
options.factory@http://localhost:3000/static/js/bundle.js:62455:31
webpack_require@http://localhost:3000/static/js/bundle.js:61907:32
@http://localhost:3000/static/js/bundle.js:63034:56
@http://localhost:3000/static/js/bundle.js:63036:12
The text was updated successfully, but these errors were encountered: