我一直在本地开发一个Web应用程序,并且一切正常。但是每当我运行npm run build
时,我的控制台都会收到以下错误消息。
./app/containers/Dashboard/Dashboard.js中的ERROR 42:27模块解析 失败:意外的关键字“ var”(42:27)您可能需要适当的关键字 加载程序来处理此文件类型。 |从导入BookDay “组件/读书日/读书日”; |从导入PatientOverview “ components / PatientOverview / PatientOverview”;
导入TreatmentPlanner,{var _ref = | / #纯 / | _jsx(ContentWidget,{},void 0,_jsx(TreatmentPlanner,{}))); }来自“ components / TreatmentPlanner / TreatmentPlanner”; @ ./app/containers/PracticePage/PracticePage.js 40:0-55 58:5-14 @ ./app/containers/PracticePage/Loadable.js @ ./app/containers/App/App.js @ ./app/app.js @多 ./node_modules/react-app-polyfill/ie11.js ./app/app.js子级 __offline_serviceworker:
我的导入看起来像这样:
import ForegroundBlobWrapper from "basicComponents/ForegroundBlob/ForegroundBlobWrapper";
import BookDay from "components/BookDay/BookDay";
import PatientOverview from "components/PatientOverview/PatientOverview";
import TreatmentPlanner from "components/TreatmentPlanner/TreatmentPlanner";
import PlannedAppointments from "components/PlannedAppointments/PlannedAppointments";
import PageTitle from "components/PageTitle/PageTitle";
另外,我的短毛猫正在向我展示一个非常奇怪的问题,它正在中断(导入TreatmentPlanner)。
import TreatmentPlanner from "components/TreatmentPlanner/TreatmentPlanner";
我试图找出问题所在,但是老实说,我不知道是什么原因造成的。
编辑:
发现问题可能出在样式化组件上,Therapyplanner包装在一个名为ContentWidget的样式化组件内,其中为空。但是,当我将其更改为普通div时,它又能正常工作吗?我现在更加困惑。