[英]Can't import package to react boilerplate
Trying to import react-image-crop
package using yarn and add it to react boilerplate
. 尝试使用纱线导入
react-image-crop
软件包并将其添加到react boilerplate
。
After installing the package getting this error 安装软件包后出现此错误
Module parse failed: /Users/...../frontend/node_modules/react-image-crop/lib/ReactCrop.js Unexpected token (62:25)
You may need an appropriate loader to handle this file type.
|
| function makeAspectCrop(crop, imageAspect) {
| const completeCrop = { ...crop };
|
| if (crop.width) {
@ ./app/components/ImageUpload/index.js 23:0-41
@ ./app/containers/HomePage/index.js
@ ./app/containers/HomePage/Loadable.js
@ ./app/containers/App/index.js
@ ./app/app.js
@ multi eventsource-polyfill webpa
The boilerplate is using babylons env
preset so the spread operator should be available. 样板使用的是babylons
env
预设,因此应该可以使用传播操作员。
Any ideas what may be the cause? 任何想法可能是什么原因?
Instead of importing directly from react-image-crop
I used 我没有直接从
react-image-crop
导入
import ReactCrop from 'react-image-crop/dist/ReactCrop';
and working like a charm 像魅力一样工作
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.