inflearn logo
강의

강의

N
챌린지

챌린지

멘토링

멘토링

N
클립

클립

로드맵

로드맵

지식공유

[리뉴얼] React로 NodeBird SNS 만들기

immer 도입하기

util/produce.js 에서 오류가 납니다

592

정현영

작성한 질문수 7

0

npm run dev를 했는데

아래와 같은 오류가 뜨면서 실행이 안됩니다

어디서 문제가 있는 건가요?

 

util/produce.js 코드 내용

import { enableES5, produce } from 'immer';

export default (...args) => {
  enableES5();
  return produce(...args);
};

 

 

터미널 에러

> react-nodebird-front@1.0.0 dev

> next -p 3060

ready - started server on 0.0.0.0:3060, url: http://localhost:3060

event - compiled client and server successfully in 668 ms (1830 modules)

wait - compiling / (client and server)...

event - compiled client and server successfully in 1185 ms (4446 modules)

4. WrappedApp created new store with withRedux(NodeBird) { initialState: undefined, initialStateFromGSPorGSSR: undefined }

{}

wait - compiling /_error (client and server)...

error - util/produce.js (4:11) @ __WEBPACK_DEFAULT_EXPORT__

error - TypeError: (0 , immer__WEBPACK_IMPORTED_MODULE_0__.enableES5) is not a function

at __WEBPACK_DEFAULT_EXPORT__ (webpack-internal:///./util/produce.js:11:53)

at reducer (webpack-internal:///./reducers/user.js:115:106)

at /Users/hyeonyeongjeong/Documents/2023project/nodebird/prepare/front/node_modules/redux/lib/redux.js:476:24

at Array.forEach (<anonymous>)

at assertReducerShape (/Users/hyeonyeongjeong/Documents/2023project/nodebird/prepare/front/node_modules/redux/lib/redux.js:474:25)

at combineReducers (/Users/hyeonyeongjeong/Documents/2023project/nodebird/prepare/front/node_modules/redux/lib/redux.js:539:5)

at eval (webpack-internal:///./reducers/index.js:19:75) {

page: '/'

}

2 |

3 | export default (...args) => {

> 4 | enableES5();

| ^

5 | return produce(...args);

6 | };

event - compiled client and server successfully in 315 ms (4447 modules)

4. WrappedApp created new store with withRedux(NodeBird) { initialState: undefined, initialStateFromGSPorGSSR: undefined }

{}

TypeError: (0 , immer__WEBPACK_IMPORTED_MODULE_0__.enableES5) is not a function

at __WEBPACK_DEFAULT_EXPORT__ (webpack-internal:///./util/produce.js:11:53)

at reducer (webpack-internal:///./reducers/user.js:115:106)

at /Users/hyeonyeongjeong/Documents/2023project/nodebird/prepare/front/node_modules/redux/lib/redux.js:476:24

at Array.forEach (<anonymous>)

at assertReducerShape (/Users/hyeonyeongjeong/Documents/2023project/nodebird/prepare/front/node_modules/redux/lib/redux.js:474:25)

at combineReducers (/Users/hyeonyeongjeong/Documents/2023project/nodebird/prepare/front/node_modules/redux/lib/redux.js:539:5)

at eval (webpack-internal:///./reducers/index.js:19:75)

at processTicksAndRejections (node:internal/process/task_queues:96:5)

^C%

react redux node.js express next.js

답변 1

0

제로초(조현영)

immer는 지금 버전에서 es5를 지원하지 않을겁니다. enableEs5를 그냥 지우세요

0

정현영

  • Since version 6, support for the fallback implementation has to be explicitly enabled by calling enableES5().

  • Version 10 drops the fallback implementation fully, and cannot be used in browsers / engines that don't support Proxy.

답변 감사합니다!

지우니까 바로 됬어요

검색 해 봤는데 혹시 이부분이

es5를 지원하지 않는다는 내용인가요?

'버전 10은 대체 구현을 완전히 삭제하고 프록시를 지원하지 않는 브라우저/엔진에서 사용할 수 없습니다.'

번역해보니까 이렇게 나오는데 무슨 뜻인가요?

 

0

제로초(조현영)

네 버전10부터는 es5 브라우저에서는 안돌아간다는 것입니다.

0

정현영

감사합니다!

넥스트 버젼 질문

0

78

2

로그인시 401 Unauthorized 오류가 뜹니다

0

89

1

무한 스크롤 중 스크롤 튐 현상

0

175

1

특정 페이지 접근을 막고 싶을 때

0

103

2

createGlobalStyle의 위치와 영향범위

0

96

2

인라인 스타일 리렌더링 관련

0

91

2

vsc 에서 npm init 설치시 오류

0

146

2

nextjs 15버전 사용 가능할까요?

0

158

1

화면 새로고침 문의

0

121

1

RTK에서 draft, state 차이가 있나요?

0

153

2

Next 14 사용해도 될까요?

0

452

1

next, node 버전 / 폴더 구조 질문 드립니다.

0

349

1

url 오류 질문있습니다

0

211

1

ssh xxxxx로 우분투에 들어가려니까 port 22: Connection timed out

0

373

1

sudo certbot --nginx 에러

0

1275

2

Minified React error 콘솔에러 (hydrate)

0

470

1

카카오 공유했을 때 이전에 작성했던 글이 나오는 버그

0

247

1

프론트서버 배포 후 EADDRINUSE에러 발생

0

327

1

npm run build 에러

0

518

1

front 서버 npm run build 중에 발생한 에러들

0

382

1

서버 실행하고 브라우저로 들어갔을때 404에러

0

338

2

css 서버사이드 랜더링이 적용되지 않아서 문의 드립니다.

0

288

1

팔로워 3명씩 불러오고 데이터 합쳐주는걸로 바꾸고 서버요청을 무한으로하고있습니다.

0

239

2

해시태그 검색에서 throttle에 관해 질문있습니다.

0

201

1