작성
·
690
답변 11
0
0
layout/workspace/index.tsx 전체 코드입니다.
0
그러면 어느 부분을 보여드려야 되나요?
app의 index.tsx 코드는 다음과 같습니다.
https://github.com/ZeroCho/sleact/blob/master/front/layouts/App/index.tsx#L16
여기가 다르네요.
이 부분이 없어서 useParams의 workspace가 undefined였습니다.
Warning: Each child in a list should have a unique "key" prop.
Check the render method of `Workspace`. See https://reactjs.org/link/warning-keys for more information.
at div
at Workspace (http://localhost:3090/dist/layouts_Workspace_index_tsx.js:797:90)
at InnerLoadable (http://localhost:3090/dist/app.js:177:34)
at LoadableWithChunkExtractor
at Loadable
at Route (http://localhost:3090/dist/app.js:54800:29)
at Switch (http://localhost:3090/dist/app.js:55002:29)
at App
at Router (http://localhost:3090/dist/app.js:54431:30)
at BrowserRouter (http://localhost:3090/dist/app.js:54048:35)
계속 주소에 undefined가 있는 것인가요? useParams에서 나온 workspace를 console.log 해보세요. 그리고 workspace를 사용하는 모든 useCallback에 [workspace]가 되어있는지도요.
app.js:1667 GET http://localhost3095/api/workspaces/sleact/channels net::ERR_NAME_NOT_RESOLVED
react_devtools_backend.js:2526 Warning: Each child in a list should have a unique "key" prop.
Check the render method of `Workspace`. See https://reactjs.org/link/warning-keys for more information.
at div
at Workspace (http://localhost:3090/dist/layouts_Workspace_index_tsx.js:797:90)
at InnerLoadable (http://localhost:3090/dist/app.js:177:34)
at LoadableWithChunkExtractor
at Loadable
at Route (http://localhost:3090/dist/app.js:54800:29)
at Switch (http://localhost:3090/dist/app.js:55002:29)
at App
at Router (http://localhost:3090/dist/app.js:54431:30)
at BrowserRouter (http://localhost:3090/dist/app.js:54048:35)
아 그렇군요.. 그런데 채널 생성은 계속 안되는거 같아요..
채널 생성 할때마다 이 오류메세지를 계속 뱉는거 같습니다,..
늦은시간까지 귀찮게 해드려서 죄송합니다.
'http://localhost:3095/api/workspaces/undefined/channels
저기 언디파인드가 들어가는 것은 onCreateChannel에 [workspace] 이런 게 없어서 그럴 수 있습니다.
0
0
아 이부분을 말씀하신것 같아서 이부분도 수정했습니다.
0
백엔드 생성 과정에서 sequelize seed:all 관련 명령어 수행하셨나요?
일단 url이 /api/workspaces/undefined/channels 입니다. 저 부분이 undefined네요.
onCreateChannel의 deps 배열에 [workspace, newChannel]이어야 하는데 workspace가 빠져있네요.
0
0
CreateChannelModal 부분쪽 코드도 올립니다.
어느 부분이 문제인지를 잘 모르겠습니다.
0
console 란에서도 아래와 같은 오류로 에러메세지를 뱉습니다.
app.js:1667 POST http://localhost:3095/api/workspaces/undefined/channels 404 (Not Found)
layouts/Workspace.tsx 보여주세요.