문제 상황 >
- npm start 시 unexpected token 발생
- 노마드코더 강의 듣는 중 발생 https://nomadcoders.co/react-masterclass
/src/Circle.tsx 21:30
Module parse failed: Unexpected token (21:30)
You may need an appropriate loader to handle this file type.
| return /*#__PURE__*/React.createElement(Container, {
| bgColor: bgColor,
> borderColor: borderColor ?? bgColor,
| __self: this,
| __source: {
해결 >
- react 버전 18 -> 17로 다운그레이드 하니까 해결됨
"dependencies": {
"@testing-library/jest-dom": "^5.17.0",
"@testing-library/react": "^13.4.0",
"@testing-library/user-event": "^13.5.0",
"@types/jest": "^29.5.3",
"@types/node": "^20.4.5",
"@types/react": "^18.2.17",
"@types/react-dom": "^18.2.7",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-scripts": "4.0.3",
"styled-components": "^6.0.5",
"typescript": "^5.1.6",
"web-vitals": "^2.1.4"
},
https://stackoverflow.com/questions/71938980/typescript-cant-understand-nullish-coalescing
반응형
'개발 > react' 카테고리의 다른 글
react. too many re-renders. react limits the number of renders to prevent an infinite loop (0) | 2023.08.17 |
---|---|
react. state가 immutable해야 하는 이유 (0) | 2023.08.15 |
pseudo class | 개념 및 &:hover 통해서 구현 (0) | 2023.08.10 |
jest-worker run build : unexpected token (0) | 2023.08.03 |