Skip to content
This repository has been archived by the owner on Apr 14, 2023. It is now read-only.

react syntax parsing error #3

Open
SoYoung210 opened this issue Oct 10, 2019 · 0 comments
Open

react syntax parsing error #3

SoYoung210 opened this issue Oct 10, 2019 · 0 comments
Labels
🆘 In Progress 원인이 명확하지 않은 이슈 ✈️ SSR ssr 구현하며 발생했던 이슈들

Comments

@SoYoung210
Copy link
Owner

SoYoung210 commented Oct 10, 2019

.
├── README.md
├── client
├── node_modules
├── package.json
├── server
├── static
├── .babelrc
├── webpack.client.js
├── webpack.server.js
└── yarn.lock

위와 같은 폴더 트리에서 yarn build:client 수행 시, React문법을 파싱할 수 없다는 에러가 난다.

image

Solve

client 폴더 내에 package.json 을 삭제해주면 해결된다.

package.json에도 babel 설정을 적어줄 수있듯, 이는 babelrc를 읽는 로직과 폴더 구조가 맞지 않기때문에 생기는 이슈인것으로 추측된다.

To Go

server와 client의 babel 필요 스펙이 다르기 때문에 .babelrc 같은 자동으로 import 되는 이름보다는 명시적인 이름을 부여하고 각 웹팩파일에서 적절한 바벨파일을 import하도록 변경해야 한다.

@SoYoung210 SoYoung210 added ✈️ SSR ssr 구현하며 발생했던 이슈들 🆘 In Progress 원인이 명확하지 않은 이슈 labels Oct 11, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🆘 In Progress 원인이 명확하지 않은 이슈 ✈️ SSR ssr 구현하며 발생했던 이슈들
Projects
None yet
Development

No branches or pull requests

1 participant