-
카테고리
-
세부 분야
풀스택
-
해결 여부
미해결
isServer error 에러가 나왔습니다 ㅠㅠ
20.05.15 08:33 작성 조회수 477
0
antd 가 v4 여서 아이콘을 넣어주려고 아래와 같은 커맨드를 넣었었습니다.
yarn add @ant-design/compatible
그 이후에 갑자기 이런 에러가 나왔어요.
Unhandled Runtime Error
TypeError: Cannot read property 'isServer' of undefined
To set up the editor integration, add something like REACT_EDITOR=atom to the .env.local file in your project folder and restart the development server.
https://github.com/minch1025/Nodebird_kwon
현재 수업은 6-13까지 마친 상태이구요 앤트디 아이콘 넣기 전까지는 동영상과 같이 정상적으로 돌아갔었습니다.
깃 확인 부탁드려요 ㅠㅠㅠ.....
답변을 작성해보세요.
1
KS Michael
2020.05.16
1. npm i redux-devtools-extension
2. import composeWithDevTools from 'redux-devtools-extension'
export default withRedux((initialState, options) => {
const middlewares = [];
const enhancer = composeWithDevTools(applyMiddleware(...middlewares));
const store = createStore(reducer, initialState, enhancer);
return store;
})(NodeBird);
이렇게 작성했더니 6.0.0 버전에서 잘 작동합니다.
아래 링크 참고했습니다.
0
KS Michael
2020.05.16
@ant-design/compatible 추가 했더니 저는 getState 에러 나요.
그래서 공홈에 있는 antd-design/icon 4.1.0 으로 했습니다. 에러 안납니다.
compatible는 왜? 에러나는지 모르겠네요...
0
KS Michael
2020.05.16
next-redux-wrapper 버전이 6버전까지 나왔습니다.
버전이 올라가면서 작동방식이 달라진것 같습니다.
https://github.com/kirill-konshin/next-redux-wrapper#upgrade-from-5x-to-6x
Major change in the way how things are wrapped in version 6.
-
Default export
withRedux
is marked deprecated, you should create a wrapperconst wrapper = createWrapper(makeStore, {debug: true})
and then usewrapper.withRedux(Page)
. -
Your
makeStore
function no longer getsinitialState
, it only receives the context:makeStore(context: Context)
. Context could beNextPageContext
orAppContext
orgetStaticProps
orgetServerSideProps
context depending on which lifecycle function you will wrap. Instead, you need to handle theHYDRATE
action in the reducer. Thepayload
of this action will contain thestate
at the moment of static generation or server side rendering, so your reducer must merge it with existing client state properly. -
App
should no longer wrap its children withProvider
, it is now done internally. -
isServer
is not passed incontext
/props
, use your own function or simple checkconst isServer = typeof window === 'undefined'
or!!context.req
or!!context.ctx.req
. -
store
is not passed to wrapped component props. -
WrappedAppProps
was renamed toWrapperProps
.
버전문제가 아닐까 추측할뿐 ,
저도 아직 해결 하진 못했습니다.
0
답변 4