【发布时间】:2021-12-19 05:23:41
【问题描述】:
我想将我的 React 应用程序部署到 github,我运行以下命令:
npm run deploy
但我不断收到此错误消息:
Module build failed: SyntaxError: 'import' and 'export' may only appear at the top level (3:4)
1 | const reportWebVitals = onPerfEntry => {
2 | if (onPerfEntry && onPerfEntry instanceof Function) {
> 3 | import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {
| ^
4 | getCLS(onPerfEntry);
5 | getFID(onPerfEntry);
6 | getFCP(onPerfEntry);
你能帮我解决这个问题吗?
【问题讨论】:
标签: reactjs github npm terminal