inflearn logo
Khóa học

Khóa học

Chia sẻ kiến thức

Bài viết của cccodus3135886

cccodus3135886 cccodus3135886

@cccodus3135886

Số lượng đánh giá đã viết
-
Xếp hạng trung bình
-

Bài viết 10

Hỏi & Đáp

배포 후 오류

여전히 '사용자를 찾을 수 없습니다' 가 나오면 어디를 더 확인해봐야할까요? screenName이 안들어와요ㅠㅠ

Lượt thích
0
Số bình luận
3
Lượt xem
1185

Hỏi & Đáp

배포 후 오류

선생님 아래와 같이 baseUrl확인 을 하고 다시 재배포를 했는데 이번엔 원래 잘 되었던 로그인도 갑자기 되지를 않습니다. https://blah-blah-beta.vercel.app/ 어디가 문제일까요 ㅠ export const getServerSideProps: GetServerSideProps = async ({ query }) => { const { screenName } = query; if (screenName === undefined) { return { props: { userInfo: null, screenName: '', }, }; } const screenNameToStr = Array.isArray(screenName) ? screenName[0] : screenName; try { const protocol = process.env.PROTOCOL || 'http'; const host = process.env.HOST || 'localhost'; const port = process.env.PORT || '3000'; const baseUrl = `${protocol}://${host}:${port}`; const userInfoResp: AxiosResponse = await axios(`${baseUrl}/api/user.info/${screenName}`); return { props: { userInfo: userInfoResp.data ?? null, screenName: screenNameToStr, }, }; } catch (err) { console.error(err); return { props: { userInfo: null, screenName: '', }, }; } }; export default UserHomePage; export const getServerSideProps: GetServerSideProps = async ({ query }) => { const { screenName, messageId } = query; if (screenName === undefined) { return { props: { userInfo: null, messageData: null, screenName: '', baseUrl: '', }, }; } if (messageId === undefined) { return { props: { userInfo: null, messageData: null, screenName: '', baseUrl: '', }, }; } try { const protocol = process.env.PROTOCOL || 'http'; const host = process.env.HOST || 'localhost'; const port = process.env.PORT || '3000'; const baseUrl = `${protocol}://${host}:${port}`; const userInfoResp: AxiosResponse = await axios(`${baseUrl}/api/user.info/${screenName}`); const screenNameToStr = Array.isArray(screenName) ? screenName[0] : screenName; if (userInfoResp.status !== 200 || userInfoResp.data === undefined || userInfoResp.data.uid === undefined) { return { props: { userInfo: null, messageData: null, screenName: screenNameToStr, baseUrl, }, }; } const messageInfoResp: AxiosResponse = await axios( `${baseUrl}/api/messages.info?uid=${userInfoResp.data.uid}&messageId=${messageId}`, ); return { props: { userInfo: userInfoResp.data, messageData: messageInfoResp.status !== 200 || messageInfoResp.data === undefined ? null : messageInfoResp.data, screenName: screenNameToStr, baseUrl, }, }; } catch (err) { console.error(err); return { props: { userInfo: null, messageData: null, screenName: '', baseUrl: '', }, }; } }; export default MessagePage;

Lượt thích
0
Số bình luận
3
Lượt xem
1185

Hỏi & Đáp

localhost:3000/api/user.info/totuworld 404 에러가 뜹니다.

members.add.ts 말씀하시는 걸까요?ㅠㅠ 해당강의가 어디일까요 지금 다시 듣고있는데,, 이 문제로 몇일 째 진도를 못나가고 있는데 코드 한 번 봐주 실 수 있나요? 어디가 문제 인지 강의를 다시보면서 찾고 있는데 처음부터 다시 만들어야하나 고민입니다... https://github.com/cccodus313/Blah-Blah/tree/start

Lượt thích
0
Số bình luận
3
Lượt xem
463

Hỏi & Đáp

TypeError: Cannot read property 'status' of undefined

터미널에서 서버 연결이 되어있다고 나오고, 터미널에는 오류메세지가 나오지 않습니다ㅠ 메트로 오류가 전부인데ㅠㅠ 더 알 수 있는 방법이 있을까요?

Lượt thích
0
Số bình luận
4
Lượt xem
1703

Hỏi & Đáp

toast 처리부터 오류발생

버전문제였나봅니다. https://www.inflearn.com/questions/696004/usetoast-%EC%97%90%EB%9F%AC 같은 문제인데 해결했습니다 :)

Lượt thích
0
Số bình luận
3
Lượt xem
622

Hỏi & Đáp

toast 처리부터 오류발생

넵! https://github.com/cccodus313/Blah-Blah 입니다.

Lượt thích
0
Số bình luận
3
Lượt xem
622