React build failed: cannot read property 'name' of undefined

Viewed 3791

I'm using create-react-app template with typescript. On my local pc, run build successfully, but when run in CI server, build failed.

  • build error

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

But there is no 'name' property in file

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",
2 Answers

Update your typescript version to @latest. 3.8.3 as of today.

Once you do that, quit your IDE and restart. I had the same issue and thought that upgrading wasn't working. Then I read in the Github issue that you need to restart the IDE. Everything worked after that fine

Related