묻고 답해요
161만명의 커뮤니티!! 함께 토론해봐요.
인프런 TOP Writers
-
해결됨시나브로 자바스크립트
쇼핑물 api 입니다.
https://learnwitheunjae.dev/api/sinabro-js/ecommerce혹시나 치기 귀찮으신 분들이 있을꺼 같아 적어놓습니다.그리고 크롬 사용하시는분들은 크롬 확장 프로그램의 JSONVue 을 검색하셔서 추가하시면 웹에서도 json 으로 format 으로 깔끔하게 보실 수 있습니다.
-
해결됨[코드캠프] 부트캠프에서 만든 고농축 백엔드 코스
비주얼스튜디오코드 폴더 복사 붙이기 문제
폴더 복사 붙여넣기 후 이름 변경시아래와 같은 에러가 뜬다면뭘 점검해 봐야 하나요?복사 붙이기로 새로 생성된 폴더 안의,파일을 열거나 하지 않았는데,복사 완료 후 폴더명 변경시 왜 오류가 나는 걸까요?답변 주시면 감사하겠습니다. Error: '03-04-rest-api-with-express-board-'을 (를) 'section03'(Error: EBUSY: resource busy or locked, rename 'c:\study\node_codecamp\class\section03\03-04-rest-api-with-express-board-' -> 'c:\study\node_codecamp\class\section03\03-04-rest-api-with-express-swagger')(으)로 이동할 수 없습니다.
-
해결됨[코드캠프] 부트캠프에서 만든 고농축 백엔드 코스
섹션22 과제5번 질무이있습니다
아래 코드를 실행할때마다 오류가 발생해서 여쭤봤습니다. 그전에 startStandaloneServer가 없을때에는 오류는 안나왔지만 grapql페이지로 접속하였을때 빨간불이 들어오고 서버가 제대로 접속되지않아서 방법을 바꾸니 typeerror가 발생했는데 어디에서도 server.addPlugin을 작성하지않았고 공식페이지에서의 방법도 해봤는데 왜 오류가 나는지 찾지를 못했습니다import { ApolloServer } from "apollo-server"; import { startStandaloneServer } from "@apollo/server/standalone"; const typeDefs = `#test # Board에 관한 Query는 # 로직 내에 Query가 없는 채로 실행했을 때 나타나는 # "Error: Query root type must be provided." 에러 방지를 위한 것입니다. type BoardReturn { number: Int writer: String title: String contents: String } type Query { fetchBoards: [BoardReturn] } type Mutation { # 1. 아래에 createTokenOfPhone API의 요청 데이터 타입을 지정해 주세요. createTokenOfPhone(phone : Int) : String } `; const resolvers = { Query: { fetchBoards: (_, args) => { return [ { number: 1, writer: "철수", title: "제목입니다", contents: "내용입니다", }, { number: 2, writer: "영희", title: "좋은 날씨입니다", contents: "내용입니다", }, ]; }, }, Mutation: { createTokenOfPhone: (_, args) => { // 2. 아래 로직을 만들어 주세요. // (힌트: phone.js 내에 존재하는 함수들을 사용해서 로직을 완성해 주시면 됩니다. // 로직 구성이 어려우신 분들은 rest_api 폴더 내에 존재하는 index.js 파일을 참고해 주세요.) // 2-1. 휴대폰번호 자릿수 맞는지 확인하기 const phone = args.phone; if (phone.length > 10 || phone.length < 10) { return "핸드폰 번호 재확인 해주세요"; } // 2-2. 휴대폰 번호 자릿수가 맞다면 핸드폰 토큰 4자리 만들기 const result = String(Math.floor(Math.random() * 1000)).padStart(4, "0"); // 2-3. 만든 토큰을 핸드폰번호에 토큰 전송하기 return `token : ${result}`; }, }, }; const server = new ApolloServer({ typeDefs, resolvers, }); await startStandaloneServer(server); // server.listen(3000).then(({ url }) => { // console.log(`🚀 Server ready at ${url}`); // });
-
해결됨[코드캠프] 부트캠프에서 만든 고농축 백엔드 코스
nodejs import 시 확장자 생략시 오류
//index.js import express from "express" const app = express() import { checkPhone } from "./phone.js" app.get("/", function (req, res) { res.send("Hello World") }) app.get("/phone", (req, res) => { const p = checkPhone() res.send(p) }) app.listen(3000) //phone.js export function checkPhone() { return true } 확장자를 생략해도 되는걸로 알고있었는데,확장자를 생략하면 왜 에러가 날까요?ERR_MODULE_NOT_FOUND에러가 나는 이유가 궁금합니다.
-
미해결비전공자를 위한 진짜 입문 올인원 개발 부트캠프
windows에서 발생하는 경로 \ 관련 문의드립니다.
"상품 업로드 기능 구현-2" 강의 중 잘 따라가다가 후반부에서 경로 문제로 인해 문의드립니다.업로드 페이지에서 업로드는 잘 되나, 업로드 후 메인 페이지에서 등록된 이미지가 나오지 않아 확인해보니 "/" 대신에 콘솔에는 캡처1과 같이 "\\" 가 나오고 DB Browser에서는 캡처2와 같이 "\"가 나옵니다. : 캡처1 입니다. : 캡처2 입니다.원인을 찾아보니 windows에서 파일 경로를 다룰 때 "\\"로 하기 때문에 생기는 문제라고 하는데요...어떻게 해결하면 좋을지 모르겠습니다.해결방법을 알려주시면 감사하겠습니다.
-
미해결Vue.js 중급 강좌 - 웹앱 제작으로 배워보는 Vue.js, ES6, Vuex
Modal.vue 의 style 에 scoped 속성을 주면 왜 slot 의 디자인이 적용되지 않는 건가요?
Modal.vue 의 style 에 scoped 속성을 주면 왜 slot 의 디자인이 적용되지 않는 건가요??인터넷을 뒤져보니 이렇게 동작하는 게 정상적이라고는 하지만, 정작 왜 그런지는 이해가 안됩니다.그리고 혹시 <style scoped> 를 쓰더라도 slot 에 디자인을 적용시킬 방법은 없을까요?
-
미해결Vue.js 완벽 가이드 - 실습과 리팩토링으로 배우는 실전 개념
Chart.js WebSocket connection to 에러
외부 라이브러리 모듈화 방법(차트)강의 듣고 있는데,App.vue에chart.js 를 import하고mounted() {}사이에 코드를 넣어 주고npm install run 으로 서버를 구동 시켰는데WebSocket connection to 'ws://192.168.2.114:8080/ws' failed: 라는 에러가 발생하네요.해당 강의가 예전에 촬영되어서 현재 상황과 안맞을 수도 있지만, 현 강의 프로젝트 구조에서 해결 방안을 알고 계시면 알려주시면 감사하겠습니다.
-
해결됨[코드캠프] 부트캠프에서 만든 고농축 백엔드 코스
section22 의 CORS 관련 질문
안녕하세요!해당 수업에서 CORS 에러가 발생한 이유를 다른 작성자 분께서 질문해주셨는데, 강사님께서 프론트엔드와 백엔드의 포트가 달라서 그렇다고 대답해주셨습니다. 백엔드에서는 app.listen을 통해 포트를 설정을 해주었지만, 프론트엔드에서는 포트를 설정한 적이 없는데 포트번호를 어떻게 알 수 있나요..?설정하는 방법이 따로 있는건가요?그리고 이전수업에서 한 컴퓨터에서는 프론트엔드와 백엔드의 포트번호가 달라야한다고 말씀하셨는데, 그렇다면 하나의 컴퓨터에서는 same origin이 될 수 없는건가요?
-
해결됨떠먹는 Three.js
섹션2 Material 학습 중에 마우스 드래그로 돌려보는 기능?
섹션2 Material 학습 중에 있는데요, 강사님 영상에서는 마우스 드래그를 통해 오브젝트가 회전하는데, 저는 안됩니다.^^; 뭔가 세팅을 하는 게 있을 것 같은데, 아마 다 공부하고 나면 알 수 있는거겠죠?
-
해결됨비전공자를 위한 진짜 입문 올인원 개발 부트캠프
import { Switch, Route } from "react-router-dom"; 모듈을 찾을수 없다고 뜹니다.
선생님 수업 따라서 열심히 따라 왔는데 여기서 막히네요.해결 좀 부탁드립니다.제가 나이가 53인데 사다리차 운전 하면서 자영업 하는데 다른길좀 가보려고 공부하는 중이거든요. 다른 분들한테는 쉬운걸 텐데 저한테는 어렵네요.구글링 해보고 네이버 도 찾아봣는데 찾을수가 없네요.이걸 해결해야 앞으로 나갈수 있을것 같은데 도와주세요.감사합니다
-
해결됨[코드캠프] 부트캠프에서 만든 고농축 백엔드 코스
파이썬이나 자바도 공부해야하나요?
이 강의만 들으면 되나요?아니면 파이썬이나 자바는 제가 따로 공부해야하나요?
-
미해결처음 만난 리액트(React)
styled-components
chapter 15 실습에서 막힙니다.styled-components를 @latest 붙여서 다운받았는데도 실행이 안됩니다.그냥 빈 하얀 화면만 뜹니다...다른 챕터는 확인해보니까 다 되던데, 왜 styled-components 실습만 왜 안될까요?Blocks.jsx 파일 코드import styled from "styled-components"; const Wrapper = styled.div` padding: 1rem; display: flex; flex-direction: row; align-items: flex-start; justify-content: flex-start; background-color: lightgrey; `; const Block = styled.div` padding: ${(props) => props.padding}; border: 1px solid black; border-radius: 1rem; background-color: ${(props) => props.backgroundColor}; color: white; font-size: 2rem; text-align: center; `; const blockItems = [ { label: "1", padding: "1rem", backgroundColor: "red", }, { label: "2", padding: "3rem", backgroundColor: "green", }, { label: "3", padding: "2rem", backgroundColor: "blue", }, ]; function Blocks(props) { return ( <Wrapper> {blockItems.map((blockItem) => { return ( <Block padding={blockItem.padding} backgroundColor={blockItem.backgroundColor} > {blockItem.label} </Block> ); })} </Wrapper> ); } export default Blocks; index.js 파일 코드import React from "react"; import ReactDOM from "react-dom/client"; import "./index.css"; import App from "./App"; import reportWebVitals from "./reportWebVitals"; // import Library from "./chapter_03/Library"; // import Clock from "./chapter_04/Clock"; // import CommentList from "./chapter_05/CommentList"; // import NotificationList from "./chapter_06/NotificationList"; // import Accomodate from "./chapter_07/Accommodate"; // import ConfirmButton from "./chapter_08/ConfirmButton"; // import LandingPage from "./chapter_09/LandingPage"; // import AttendanceBook from "./chapter_10/AttendanceBook"; // import SignUp from "./chapter_11/SignUp"; // import Calculator from "./chapter_12/Calculator"; // import ProfileCard from "./chapter_13/ProfileCard"; // import DarkOrLight from "./chapter_14/DarkOrLight"; import Blocks from "./chapter_15/Blocks"; const root = ReactDOM.createRoot(document.getElementById("root")); root.render( <React.StrictMode> <Blocks /> </React.StrictMode> ); // If you want to start measuring performance in your app, pass a function // to log results (for example: reportWebVitals(console.log)) // or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals reportWebVitals();빈 하얀 화면에서 F12 눌러서 오류 확인해보니까 이렇게 뜹니다.Warning: Each child in a list should have a unique "key" prop.Check the render method of Blocks. See https://reactjs.org/link/warning-keys for more information. at O (http://localhost:3000/static/js/bundle.js:43804:6) at BlocksprintWarning @ react-jsx-dev-runtime.development.js:872react.development.js:209 Warning: Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:1. You might have mismatching versions of React and the renderer (such as React DOM)2. You might be breaking the Rules of Hooks3. You might have more than one copy of React in the same appSee https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.printWarning @ react.development.js:209react.development.js:1618 Uncaught TypeError: Cannot read properties of null (reading 'useContext') at Object.useContext (react.development.js:1618:1) at StyledComponent.ts:124:1 at O (StyledComponent.ts:190:1) at renderWithHooks (react-dom.development.js:16305:1) at updateForwardRef (react-dom.development.js:19226:1) at beginWork (react-dom.development.js:21636:1) at HTMLUnknownElement.callCallback (react-dom.development.js:4164:1) at Object.invokeGuardedCallbackDev (react-dom.development.js:4213:1) at invokeGuardedCallback (react-dom.development.js:4277:1) at beginWork$1 (react-dom.development.js:27451:1)2react.development.js:209 Warning: Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:1. You might have mismatching versions of React and the renderer (such as React DOM)2. You might be breaking the Rules of Hooks3. You might have more than one copy of React in the same appSee https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.printWarning @ react.development.js:209react.development.js:1618 Uncaught TypeError: Cannot read properties of null (reading 'useContext') at Object.useContext (react.development.js:1618:1) at StyledComponent.ts:124:1 at O (StyledComponent.ts:190:1) at renderWithHooks (react-dom.development.js:16305:1) at updateForwardRef (react-dom.development.js:19226:1) at beginWork (react-dom.development.js:21636:1) at HTMLUnknownElement.callCallback (react-dom.development.js:4164:1) at Object.invokeGuardedCallbackDev (react-dom.development.js:4213:1) at invokeGuardedCallback (react-dom.development.js:4277:1) at beginWork$1 (react-dom.development.js:27451:1)react-dom.development.js:18687 The above error occurred in the <styled.div> component: at O (http://localhost:3000/static/js/bundle.js:43804:6) at BlocksConsider adding an error boundary to your tree to customize error handling behavior.Visit https://reactjs.org/link/error-boundaries to learn more about error boundaries.logCapturedError @ react-dom.development.js:18687react-dom.development.js:26923 Uncaught TypeError: Cannot read properties of null (reading 'useContext') at Object.useContext (react.development.js:1618:1) at StyledComponent.ts:124:1 at O (StyledComponent.ts:190:1) at renderWithHooks (react-dom.development.js:16305:1) at updateForwardRef (react-dom.development.js:19226:1) at beginWork (react-dom.development.js:21636:1) at beginWork$1 (react-dom.development.js:27426:1) at performUnitOfWork (react-dom.development.js:26557:1) at workLoopSync (react-dom.development.js:26466:1) at renderRootSync (react-dom.development.js:26434:1) 뭐가 문제일까요?
-
미해결처음 만난 리액트(React)
npm start 하고 localhost:3000으로 접속할때 로드오류
npm start 하고 localhost:3000으로 접속이 되었고, 리액트 로딩창만 나오고 다음창이 로드가 안됩니다. 터미널에서도 successfully 뜨고 코드도 오류가 없습니다. 왜 로딩이안될까요 ? 단순 컴퓨터문제일까요?
-
미해결자바스크립트 알고리즘 문제풀이 입문(코딩테스트 대비)
질문이 있어서 남겨봅니다..
- 학습 관련 질문을 남겨주세요. 상세히 작성하면 더 좋아요! - 먼저 유사한 질문이 있었는지 검색해보세요. - 서로 예의를 지키며 존중하는 문화를 만들어가요. - 잠깐! 인프런 서비스 운영 관련 문의는 1:1 문의하기를 이용해주세요.function solution(arr) { let answer = 0; let dx = [-1, 0, 1, 0]; let dy = [0, -1, 0, 1]; for (let i = 0; i < arr.length; i++) { for (let j = 0; j < arr.length; j++) { console.log(arr[i][j]); for (let k = 0; k < 4; k++) { let nx = i + dx[k]; let ny = j + dy[k]; if ( nx >= 0 && nx < arr.length && ny < arr.length && ny >= 0 && arr[i][j] > arr[nx][ny] ) { answer++; } } } } return answer; }알려주신 것처럼 flag 변수로 아닌 것을 찾아서 숫자를 늘려주는 것과 맞는 경우에 늘려주는 것이 어떤 차이가 있는건지 헷갈리네요...
-
미해결Vue.js 중급 강좌 - 웹앱 제작으로 배워보는 Vue.js, ES6, Vuex
깃허브 권한 요청 드립니다.
- 인프런 아이디: kdkj1234@naver.com- 인프런 이메일: kdkj1234@naver.com- 깃허브 아이디: kdkj1234@gmail.com- 깃허브 username: juheeeeeee12
-
미해결비전공자를 위한 진짜 입문 올인원 개발 부트캠프
main/index.js과 product/index.js에서 setProduct 관련 문의드립니다.
main/index.js 에서는setProducts(result.data.products); 로 써야하고product/index.js 에서는setProducts(result.data); 로 써야하는데두 파일에서 return문에서는 동등하게 {product.name} , {product.price} 등으로 사용됩니다. 둘의 차이를 알려주시면 감사하겠습니다.
-
미해결비전공자를 위한 진짜 입문 올인원 개발 부트캠프
import시 {} 유무의 차이는 무엇인가요?
import axios from 'axios'; 에서는 중괄호가 없고import {Link} from 'react-router-dom' 에서는 중괄호가 있는데 차이가 뭔지 잘 모르겠습니다.axios는 'axios' 안에 있는 함수를 import 하는 것이고 {Link} 는 'react-router-dom' 안에 많은 컴포넌트 중 Link만 import 하기 위함인가요?
-
해결됨[코드캠프] 부트캠프에서 만든 고농축 백엔드 코스
버전 2으로 듣기
버전1으로 듣다가 버전2가 있다는 걸 알게 되어서 버전 1 말고 버전2으로 들어도 되나요?버전2는 처음부터 들으려고요
-
해결됨비전공자를 위한 진짜 입문 올인원 개발 부트캠프
useState를 사용하는 이유가 무엇인가요?
빈 배열을 선언해서 빈 배열에 (axios 통신을 통해 전달받은) result.data를 대입해서 사용하는 것이 아니라 useState를 사용하는 이유는 무엇인가요?제가 이해한 것은 서버에 새로운 데이터가 업로드되면 그때마다 바로바로 업로드 된 데이터를 화면에 보여주기 위함인 것 같은데(예를 들어 상품이 3개로 보이다가 관리자가 상품을 한 개 추가하면 새로고침을 안해도 4개로 보임), 올바르게 이해한 것이 맞을까요?
-
해결됨[코드캠프] 부트캠프에서 만든 고농축 백엔드 코스
oauth 관련 질문 있어요.
안녕하세요. 강의 잘 듣고 있습니다.user - service - google가 있다고 했을 때,user가 oauth code grant방식으로 login을 하면 service가 callback을 통해 code를 받게되고, 그 정보와 다른 정보를 조합하여 google로 부터 access token과 refresh token을 받아올텐데요.여기서 token을 어떤식으로 처리하는지 궁금합니다.service가 google로 부터 받은 token들을 app으로 전달하는 건가요? 그렇다면 app은 token이 만료되면 google에 직접 토큰을 다시 요청하는걸까요? 아니면 service를 통해 relay를 해서 토큰을 다시 요청할까요? service는 token이 올바른건지는 검증할 수 없으니 db에 저장을 해 두고 나중에 같은 토큰을 user로부터 받았을때 같은지 비교해서 허용할 지 말지 알 수 있을거 같은데 이렇게 하는건가요?아니면 service가 직접 새로운 토큰들을 생성해서 관리하는게 좋을까요?그리고 public app에서 보안을 더 강화하기 위해 pkce방식도 쓰는거 같던데 실제 많이 쓰시는지 궁금하네요.답변 부탁드립니다.감사합니다.