0

私のreact-reduxアプリにairbnbsのreact-dates datepickerを実装しようとしています。

webpack から受け取ったエラー:

ERROR in ./node_modules/react-dates/lib/css/_datepicker.css
Module parse failed: C:\my-app\node_modules\react-dates\lib\css\_
datepicker.css Unexpected token (1:0)
You may need an appropriate loader to handle this file type.
| .CalendarDay {
|   border: 1px solid #e4e7e7;
|   padding: 0;
 @ ./src/components/ExpenseForm.js 15:0-46
 @ ./src/components/AddExpense.js
 @ ./src/routers/AppRouter.js
 @ ./src/app.js
 @ multi (webpack)-dev-server/client?http://localhost:8080 ./src/app.js

私が使用しているパッケージのバージョン:

react-dates@12.7.0 react-addons-shallow-compare@15.6.0

それらをインポートする方法(コンポーネント内):

import { SingleDatePicker } from 'react-dates'
import 'react-dates/lib/css/_datepicker.css'

最新バージョンにアップグレードする必要があります - これによりアプリが再び壊れますか?

クライアントのエラー (chrome: コンソール ログ):

Uncaught Error: Module parse failed: C:\my-app\node_modules\react-dates\lib\css\_datepicker.css Unexpected token (1:0)
You may need an appropriate loader to handle this file type.
| .CalendarDay {
|   border: 1px solid #e4e7e7;
|   padding: 0;
    at eval (553:1)
    at Object.<anonymous> (bundle.js:3558)
    at __webpack_require__ (bundle.js:20)
    at eval (ExpenseForm.js?8c50:3)
    at Object.<anonymous> (bundle.js:3146)
    at __webpack_require__ (bundle.js:20)
    at eval (AddExpense.js?a8b4:2)
    at Object.<anonymous> (bundle.js:3139)
    at __webpack_require__ (bundle.js:20)
    at eval (AppRouter.js?e39b:5)
4

0 に答える 0