React-day-picker: Module not found: Error: Can't resolve 'moment' from DayPickerInput

Created on 12 Oct 2017  路  3Comments  路  Source: gpbl/react-day-picker

Trying to add DayPickerInput to a project, but it blows up my webpack build.

ERROR in ./~/react-day-picker/lib/src/DayPickerInput.js
Module not found: Error: Can't resolve 'moment' in '/project/node_modules/react-day-picker/lib/src'
 @ ./~/react-day-picker/lib/src/DayPickerInput.js 20:14-31
 @ ./~/react-day-picker/DayPickerInput.js
 @ ./app/components/PropertyDetail/Contact/index.jsx
 @ ./app/containers/PropertyDetail/index.jsx
 @ ./app/routeConfig.js
 @ ./app/routes.js
 @ ./app/app.js
 @ multi eventsource-polyfill webpack-hot-middleware/client?reload=true ./app/app.js

My code is just this.

import DayPickerInput from 'react-day-picker/DayPickerInput';

const Cal = <DayPickerInput
              locale="en"
              placeholder="DD/MM/YYYY"
              format="DD/MM/YYYY"
              value={''}
            />;

export Cal;

Most helpful comment

@TrySound is right! @davidjbradshaw please npm add moment to your dependencies, thanks!

All 3 comments

@davidjbradshaw Input component requires moment.js, just install it.

@TrySound is right! @davidjbradshaw please npm add moment to your dependencies, thanks!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

LucasBassetti picture LucasBassetti  路  3Comments

laidinidis picture laidinidis  路  6Comments

trevordmiller picture trevordmiller  路  4Comments

samsch picture samsch  路  6Comments

pmartiner picture pmartiner  路  3Comments