Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

20.3 서버 사이드 렌더링 구현하기 yarn eject 후 error #348

Open
jeongyeonKimm opened this issue Feb 15, 2022 · 2 comments
Open

Comments

@jeongyeonKimm
Copy link

책에서 언급된 바와 같이 yarn eject 후 대부분의 파일에서 가장 앞부분에 짧은 빨간 밑줄이 생깁니다.

오류 내용은 다음과 같습니다.

Parsing error: [BABEL] /Users/kim_jeongyeon/Documents/ssr-recipe/src/components/Red.js: Using babel-preset-react-app requires that you specify NODE_ENV or BABEL_ENV environment variables. Valid values are "development", "test", and "production". Instead, received: undefined. (While processing: "/Users/kim_jeongyeon/Documents/ssr-recipe/node_modules/babel-preset-react-app/index.js")

yarn eject 후에는 항상 해당 오류가 발생하는데 어떻게 해결해야 하나요?

@jeongyeonKimm jeongyeonKimm changed the title 20.3 서버 사이드 렌더링 구현하기 yarn eject 후 error가 발생합니다. 20.3 서버 사이드 렌더링 구현하기 yarn eject 후 error Feb 15, 2022
@linear14
Copy link

linear14 commented Mar 1, 2022

package.json 내부 eslintConfig 속성에 아래 설정을 통해 해결했습니다.

"eslintConfig": {
    "env": {
      "NODE_ENV": "development"
    }
    // more ...
}

Reference

@gwin-lim
Copy link

나중에 프로덕션 빌드나 테스트 과정에서 다이나믹하게 package.json 저 부분의 NODE_ENV 값을 바꿔줘야 하는 이슈가 생기지는 않겠죠?
ejected 된 리액트 설정에서 다이나믹 하게 바꿔 주는 듯 하니...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants