Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature/#80] MSW 적용 #83

Merged
merged 11 commits into from Oct 16, 2022
Merged

[Feature/#80] MSW 적용 #83

merged 11 commits into from Oct 16, 2022

Conversation

hayoung123
Copy link
Contributor

  • MSW 적용하면서 만난 이슈 정리 wiki

Copy link
Contributor

@Zih0 Zih0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SSR에 MSW 이슈 잘 정리해줘서 이해 완전 잘되었음!!

Comment on lines +5 to +8
"name": "Next.js: debug server-side",
"type": "node-terminal",
"request": "launch",
"command": "npm run dev"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이 vscode 설정파일은 어떤 역할인거야?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

요건 breakpoint 걸어두고 디버거 돌리면서 디버깅했는데, nextJS에서 디버깅 돌릴 때 넣어줘야되는 것 같더라고?

@@ -11,6 +11,9 @@ const nextConfig = {
images: {
domains: ['7th-team2-seeya-archive.s3.ap-northeast-2.amazonaws.com'],
},
experimental: {
esmExternals: false,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이건 어떤 이유로 false로 설정해준거야?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

msw가 node 12 기준으로 되어있어서 esm을 지원안하고있어. nextJS 12버전부터는 esmExternals: true가 default인데 true면 CommonJS보다 ESM을 먼저 로딩하는 것 같던데(링크) 그때 충돌이 나는지 MSW사용할 때 에러가 발생하더라고. 그래서 꺼줬어

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pure ESM모듈이 혹시 적용안되나 chalk v5 다운받아서 테스트해봤는데 잘되길래 괜찮구나 싶어서 저렇게 해놨어! 혹시 라이브러리 다운받을 때 이슈생기면 저 부분일 수도 있어서 알아두면 좋을 것 같아

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

아 오키오키 👍
나도 찾아봤는데 msw이 esm 지원 작업중인 것 같아 링크
나중에 저 PR 반영되면 요 옵션 빼줘도 될 듯!

@@ -21,7 +21,7 @@ export const HallIcon: FC<Props> = ({ name, iconName, concertHallId }) => {
const [isMouseEnter, setIsMouseEnter] = useState(false);

const handleClick = () => {
if (!concertHallId) {
if (concertHallId === undefined) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

undefined일 때만으로 바꾼 이유도 궁금합니다~

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

목데이터 넣다가 concertHallId를 0으로 넣었는데 그런 케이스도 있을 것 같아서 undefined로 확정지어줬어!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants