
이번 글을 통해 배워갈 내용
- Netlify에서 500 혹은 404 에러가 발생 및 해결
리액트 코드 자체문제가 아닌 배포환경의 문제가 있는 경우가 있습니다.
로컬에서 개발자 모드로 돌릴 때는 문제가 없다가
배포 후에만 문제가 발생하면 당혹스러운 경우가 있는데요
500 에러의 경우 SSR 서버사이드에서 렌더 할 때 발생하는 경우가 있습니다
리액트 18 버전의 Nextjs에서 Dynamic Route를 중첩해서 사용하는 경우
App 라우터와 함께 병행해서 사용하는 경우에 많이 발생하는데요
대부분의 경우 에러가 발생하는 페이지에 SSR을 false로 변경하고
nextjs에 프로젝트 루트 디렉토리에 netlify.toml 파일을 생성한 다음
아래와 같이 설정해서 해결하였습니다
[build]
command = "next build"
publish = ".next"
[[plugins]]
package = "@netlify/plugin-nextjs"
Vite에서 404가 뜨는 경우
프로젝트 루트 디렉터리에
netlify.toml 파일을 생성합니다
Vite의 경우 아래의 내용을 추가해서 해결하였습니다.
[[redirects]]
from = "/*"
to = "/index.html"
status = 200
https://answers.netlify.com/t/netlify-deploy-error-500-impossible-to-deploy/70463
Netlify deploy, Error 500, impossible to deploy
Hi there, I’m having some trouble deploying my new app (siteId: 63a409c0-76ec-4be0-af84-709afdef2524). Build is successful and for a graphql/react app but deploy encounters an error 500. I have this toml : [build] command = "yarn build" functions = "lamb
answers.netlify.com
https://github.com/netlify/cli/issues/4580
JSONHTTPError when deploying Next.js app inside Nx workspace · Issue #4580 · netlify/cli
Describe the bug I'm trying to deploy a next.js app that's inside a Nx workspace using netlify-cli. I have configured the build settings as show below in the netlify.toml file and in the netlify UI...
github.com
https://codemasterkimc.tistory.com/50
300년차 개발자의 좋은 코드 5계명 (Clean Code)
이번 글을 통해 배워갈 내용 좋은 코드(Clean Code)를 작성하기 위해 개발자로서 생각해볼 5가지 요소를 알아보겠습니다. 개요 좋은 코드란 무엇일까요? 저는 자원이 한정적인 컴퓨터 세상에서 좋
codemasterkimc.tistory.com
'Javascript > 웹 기타' 카테고리의 다른 글
| 웹페이지 전체 캡처하는 한가지 방법 (2) | 2024.11.07 |
|---|---|
| Chrome 브라우저에서 silent printing 해보기 (0) | 2023.09.12 |
| VS Code 에서 Prettier 전역으로 적용하는 명령어 (1) | 2023.05.30 |
| nodejs 로깅에 시간추가하는 한가지 꿀방법 (0) | 2023.03.07 |
| CSS 기본 스타일 무시하는 한가지 방법 (0) | 2022.07.21 |