Jiwoo Hong
Jiwoo Hong

Reputation: 33

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

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

./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",

Upvotes: 3

Views: 4085

Answers (2)

BRANDON ROBERTS
BRANDON ROBERTS

Reputation: 46

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

Upvotes: 2

Dániel Szabó
Dániel Szabó

Reputation: 374

It seems to be an issue with 'typescript-eslint'.

It could be resolved by updating Typescript version to 3.8.x - as pointed out by user Phoebus at an other question: https://stackoverflow.com/a/60734819/5758225

Github issue (and PR link in comments): https://github.com/typescript-eslint/typescript-eslint/issues/1746

Upvotes: 6

Related Questions