• 카테고리

    질문 & 답변
  • 세부 분야

    풀스택

  • 해결 여부

    해결됨

6-3 강좌 따라 코딩중인데요 질문드립니다

19.07.25 03:54 작성 조회수 315

0

안녕하세요, 6-3 강좌 따라 코딩중인데요 

아래와 같은 에러로 다음강좌로 못넘어가고 있습니다

도와주세요 ㅠㅠ

 
ypeError: Cannot read property 'getInitialProps' of undefined
_callee$
./pages/_app.js:34
31 | pageProps: PropTypes.object.isRequired,
32 | };
33 |
> 34 | NodeBird.getInitialProps = async (context) => {
35 | console.log('getInitialProps is running!!!!');
36 |
37 | // console.log(context);
<button style="margin-bottom:1.5em;color:#878e91;cursor:pointer;display:block;width:811px;text-align:left;background:#ffffff;font-family:Consolas, Menlo, monospace;font-size:1em;padding:0px;line-height:1.5;border:initial none initial">View compiled</button>
<button style="color:#293238;cursor:pointer;display:block;width:811px;text-align:left;background:#ffffff;font-family:Consolas, Menlo, monospace;font-size:1em;padding:0px;line-height:1.5;margin-bottom:1.5em;border:initial none initial">▶ 8 stack frames were collapsed.</button>
Function.getInitialProps
./pages/_app.js:34
31 | pageProps: PropTypes.object.isRequired,
32 | };
33 |
> 34 | NodeBird.getInitialProps = async (context) => {
35 | console.log('getInitialProps is running!!!!');
36 |
37 | // console.log(context);
<button style="margin-bottom:1.5em;color:#878e91;cursor:pointer;display:block;width:811px;text-align:left;background:#ffffff;font-family:Consolas, Menlo, monospace;font-size:1em;padding:0px;line-height:1.5;border:initial none initial">View compiled</button>
<button style="color:#293238;cursor:pointer;display:block;width:811px;text-align:left;background:#ffffff;font-family:Consolas, Menlo, monospace;font-size:1em;padding:0px;line-height:1.5;margin-bottom:1.5em;border:initial none initial">▶ 4 stack frames were collapsed.</button>
This screen is visible only in development. It will not appear if the app crashes in production.
Open your browser’s developer console to further inspect this error.

답변 3

·

답변을 작성해보세요.

0

네네 그래서 나중에 오타를 잡기 위해 typescript를 사용하거나, 좋은 IDE의 도움을 받습니다.

0

호서기님의 프로필

호서기

질문자

2019.07.25

찾았습니다. 오타가 있었네요 ㅠㅠ

Context 에서 구조분해 할때는 componet 라고 받고

실제 사용할때는 component라고 했네요 

java 할때는 ide단이나 컴파일 단에서 이러한 오타 다 잡아줬었는데

javascript는 이런부분에서 너무 힘드네요 일일이 다찾아야 하다니 ㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠ

그래도 SI 천지이 java 에서 벗어나야겠네요 ㅠㅠㅠㅠ

강좌너무 잘보고있습니다

0

호서기님의 프로필

호서기

질문자

2019.07.25

참고로 front쪽 에 남김 로그입니다.

 

 

getInitialProps is running!!!!

getInitialProps is running!!!!

getInitialProps is running!!!!

getInitialProps is running!!!!

GET /Users/hoseokbaek/workspace/react/react-nodebird/front/node_modules/regenerator-runtime/runtime.js 404 873.954 ms - 5913

GET /Users/hoseokbaek/workspace/react/react-nodebird/front/.next/server/static/development/pages/_app.js 404 871.974 ms - 5913

GET /Users/hoseokbaek/workspace/react/react-nodebird/front/node_modules/core-js/library/modules/_export.js 404 869.771 ms - 5913

GET /Users/hoseokbaek/workspace/react/react-nodebird/front/node_modules/next-redux-wrapper/lib/index.js 404 867.896 ms - 5913

GET /_next/webpack-hmr?page=/ 200 0.921 ms - -

[ ready ] compiled successfully

GET /_next/static/webpack/db8988c399e5bddd2fa1.hot-update.json 200 577.148 ms - 35

getInitialProps is running!!!!

GET / 200 13.344 ms - 6115

GET /_next/static/runtime/webpack.js?ts=1564019786869 200 3.240 ms - 34960

GET /_next/static/runtime/main.js?ts=1564019786869 200 3.507 ms - 836522

GET /_next/static/development/dll/dll_92fa9139568d8c3d8f78.js?ts=1564019786869 200 2.086 ms - 901660

GET /_next/static/runtime/webpack.js.map 200 2.725 ms - 36238

GET /_next/static/development/dll/dll_92fa9139568d8c3d8f78.js.map 200 3.117 ms - 1046210

GET /_next/static/chunks/0.js 200 0.693 ms - 440

GET /_next/static/chunks/0.js.map 200 3.652 ms - 99

GET /_next/static/development/pages/index.js.map 200 1635.243 ms - 6084792

GET /_next/static/runtime/main.js.map 200 7.001 ms - 754571

GET /_next/static/development/pages/_app.js?ts=1564019786869 200 1.490 ms - 6866105

GET /_next/static/development/pages/index.js?ts=1564019786869 200 529.743 ms - 6678210

GET /_next/static/development/pages/_app.js.map 200 0.927 ms - 6238781

GET /_next/development/server/static/development/pages/_app.js 200 3.697 ms - 149266

getInitialProps is running!!!!

GET /Users/hoseokbaek/workspace/react/react-nodebird/front/node_modules/regenerator-runtime/runtime.js 404 20.418 ms - 5913

getInitialProps is running!!!!

GET /Users/hoseokbaek/workspace/react/react-nodebird/front/.next/server/static/development/pages/_app.js 404 22.560 ms - 5913

getInitialProps is running!!!!

GET /Users/hoseokbaek/workspace/react/react-nodebird/front/node_modules/core-js/library/modules/_export.js 404 34.662 ms - 5913

getInitialProps is running!!!!

GET /Users/hoseokbaek/workspace/react/react-nodebird/front/node_modules/next-redux-wrapper/lib/index.js 404 97.201 ms - 5913

GET /_next/development/server/static/development/pages/_app.js.map 200 1.037 ms - 73383

GET /_next/static/development/pages/index.js.map 200 170.547 ms - 6084792

 

------------------------------------------------------------------------------------------------------------------

 

getInitialProps is running!!!! 이 로그가

 

NodeBird.getInitialProps = async (context) => {

함수 안에 남긴 로그인데 

보시는바와같이 처음에 계속찍히다가 404 에러와 또 함께찍히네요 ㅠㅠ