reactjs - React 构建失败 : cannot read property 'name' of undefined

标签 reactjs antd react-app-rewired

我正在使用带有 typescript 的 create-react-app 模板。在我的本地电脑上,运行构建成功,但是在 CI 服务器中运行时,构建失败。

  • 构建错误

./src/store/redux/info/index.ts Syntax error: Cannot read property 'name' of undefined (0:undefined)

但文件中没有“名称”属性

info/index.ts

export { default } from "./reducer";
export * from "./actions";
export * from "./types";
 "react": "16.12.0",
 "react-app-rewired": "2.1.5",
 "antd": "3.26.5",
 "antd-theme-webpack-plugin": "1.3.0",
 "typescript": "3.7.4",
    "build": "react-app-rewired --max-old-space-size=8192 build",

最佳答案

这似乎是 'typescript-eslint' 的问题。

可以通过将 Typescript 版本更新为 3.8.x 来解决 - 正如用户 Phoebus 在另一个问题中指出的那样:https://stackoverflow.com/a/60734819/5758225

Github 问题(以及评论中的 PR 链接):https://github.com/typescript-eslint/typescript-eslint/issues/1746

关于reactjs - React 构建失败 : cannot read property 'name' of undefined,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60751032/

相关文章:

javascript - 我应该在调度时捕获 Redux promise 错误还是只在 reducer 中处理它?

json - 从传统的 Laravel/Rails 应用程序迁移到 React.js 生态系统。需要在前端进行数据管理

javascript - 如何实现与数字输入绑定(bind)范围的 slider

reactjs - create-react-app 与 storybook 6.1.6 集成并且构建有错误

javascript - 从本地存储中删除后重新渲染 react 组件?

javascript - 对象作为 React 子对象无效(发现 : [object Promise])

javascript - 我可以选择哪个 AntD 图标与 allowClear = true 一起使用吗?

javascript - 如何从 Ant design 的 Select/Option 组件中获取值

reactjs - 绝对路径在 create-react-app 中不起作用

reactjs - 如何使用 Webpack 和 React 将类型文件作为文本加载?