[Next.js ] GET http://localhost:3000/ 500 (Internal Server Error) | index.js:654 Uncaught TypeError: Cannot read properties of undefined (reading 'getInitialProps')
2023. 10. 30. 08:15
개발/Error note
강의를 따라하던중 Next.js에 리덕스(리덕스툴킷x 일단 리덕스로하고 강의끝내고 마이그레이션할 것!)를 추가했는데 GET http://localhost:3000/ 500 (Internal Server Error) index.js:654 Uncaught TypeError: Cannot read properties of undefined (reading 'getInitialProps') 이렇게 에러가 빠방 떴다. 해결방법 // _app.js import React from 'react'; import Head from 'next/head'; import PropTypes from 'prop-types'; import wrapper from '../store/configureStore'; const Node..
[Android] Entry name 'res/animator/linear_indeterminate_line1_head_interpolator.xml' collided
2023. 10. 20. 07:52
개발/Error note
Entry name 'res/animator/linear_indeterminate_line1_head_interpolator.xml' collided 안드로이드 빌드하는데 위의 오류가떴다 해결방법 Build - Clean Project 빌드중에 소스나 설정들이 꼬인거라 Clean Project를 하고 다시 빌드를 해주면 BUILD SUCCESSFUL 이 뜨는걸 볼 수 있다.
[Next.js] Next 에서 이미지 넣기 (img태그 대신 Image 컴포넌트 사용하기!)
2023. 10. 13. 13:03
개발/Error note
이미지..가.. 엑박...이다.. export default function Home() { ...코드생략 return(...코드생략 ...코드생략 ) }img 태그 방식을 그대로 썼는데 오류가 났다. 그래서 create-next-app때 나왔던 이미지는 어떻게 불러왔나 살펴보니 import Image from 'next/image'; export default function Home() { ...코드생략 return(...코드생략 ...코드생략 ) }이렇게 next/image에서 Image 컴포넌트를 불러와서 사용하고 있었다. 그리고 이미지 부르는 경로가 public 폴더 아래에 넣어두면 그냥 바로 가져다 쓸 수있어보였다. export default function Home() { ...코드생략 re..
[webpack]app.ts:17 Uncaught ReferenceError: process is not defined
2023. 9. 29. 11:53
개발/Error note
[오류 발생 상황] axios .get( `https://maps.googleapis.com/maps/api/geocode/json?address=${encodeURI( enteredAddress )}=${process.env.REACT_APP_GOOGLE_GEO_API}` ) .then((response) => console.log(response)) .catch((err) => console.error(err)); API 키를 .env에 저장하고 사용하려고 하니 process가 정의되지 않았다는 오류가 떴다. 웹팩5부터는 직접 설정을 해줘야 한다고 적혀있었다. (스택오버플로우 짱짱) [해결방법] //webpack.config.js const path = require('path'); const dot..
[TypeScript] TS1238: Unable to resolve signature of class decorator when called
2023. 9. 16. 00:20
개발/Error note
기존에 만들어져있던 tsc 프로젝트에 웹팩과 html 그리고 설정들을 바꾼 후 npm start를 해줬더니 위와같은 오류가 쏟아져나왔다. 해당오류로 검색해보니 스택오버플로우에 답이 있었다. 문제는 클래스와 데코레이터가 있는 프로젝트에 있던 tsconfig를 지우고 다시 설정하는중에 웹팩 설정만 신경쓰느라 아래의 tsconfig설정을 해주지 않았던것."strictPropertyInitialization": false "experimentalDecorators": true 그래서 tsconfig.json에 두 설정을 추가해줬다. 이후 다시 npm start를 해주고 깨끗한 콘솔창을 볼 수 있었다. tsconfig는 아직도 어렵다 ;-; 참고 - https://stackoverflow.com/questions..