react-date-range icon indicating copy to clipboard operation
react-date-range copied to clipboard

Module parse failed

Open christianto88 opened this issue 6 years ago • 3 comments

Subject of the issue

It gives error when trying to npm start . image

[BUG] Bug Reproduce Steps

Tell us how to reproduce this issue. Error when npm start

[BUG] Expected behaviour

Environment

Package Version: v1.0.1 React version: v16.8.6 Node version: v12.16.1 Browser: Chrome

christianto88 avatar Feb 25 '20 03:02 christianto88

Hi, thanks for pointing out. We also encountered this problem yesterday. In the latest fix on npm (v1.0.3), It should be solved. Can you confirm that the last version solves this issue?

The problem was about targeted Node versions in Babel configuration file, and it has been changed to cover a broader set of versions.

onurkerimov avatar Feb 27 '20 09:02 onurkerimov

the problem still exists.

Latest package version from npm: 1.0.3 react: 16.10.2 node: 12.16.1

ERROR in ./node_modules/react-date-range/dist/components/Calendar/index.js Module not found: Error: Can't resolve 'date-fns/locale/en-US' in '/.../node_modules/react-date-range/dist/components/Calendar'

outermedia-kha avatar Feb 27 '20 17:02 outermedia-kha

You need to install date-fns in your node_modules. As of the version 1.0.0, this module expects date-fns as a peerDependency. Just run npm install date-fns in your project folder and it should be OK.

You can use this sandbox as an example: https://codesandbox.io/s/react-date-range-example-bqksq

onurkerimov avatar Feb 28 '20 09:02 onurkerimov