묻고 답해요
161만명의 커뮤니티!! 함께 토론해봐요.
인프런 TOP Writers
-
해결됨[코드캠프] 부트캠프에서 만든 고농축 프론트엔드 코스
회원가입 폼 과제 정답
안녕하세요, 혹시 강의에 나와 있는 회원가입 폼 피그마로 되어 있는 부분 정답지는 따로 알 수 없는걸까요 선생님?
-
해결됨[코드캠프] 부트캠프에서 만든 고농축 백엔드 코스
도커내부 접속 안됨
docker run 이미지ID 하고 새로운 터미널 열어서 docker ps 로 containerID 확인 후docker exec -it 명령어 사용해서 도커 내부로 들어가려고 하면 OCI runtime exec failed: exec failed: unable to start container process: exec: "C:/Program Files/Git/usr/bin/bash": stat C:/Program Files/Git/usr/bin/bash: no such file or directory: unknown이런식으로 오류가 뜹니다 왜 그런건가요??해결 방법 알려주세요!
-
미해결mongoDB 기초부터 실무까지(feat. Node.js)
라우터 리팩토링
해당부분 진행중에,userId 를 넣은 get, post, delete 요청을 할경우, 강의와는 다르게아래와 같이 error 메세지가 뜹니다.뭐가 문제인걸까요? userId가 아닌, /user 로 하는 라우팅은 잘 되고 있습니다.///내용 추가이후 강의에서 같은 문제가 발생하여, mongoose를 불러오는 코드를 추가하시는데요.이부분 앞 강의에서 언급이 되거나 수정이 필요해보입니다.
-
미해결mongoDB 기초부터 실무까지(feat. Node.js)
섹션4 진행중, mongoose 질문
MONGO_URI, 이후 부분들은 작성안해도 에러가 안나는데,굳이해야하나요? 버젼이 업데이트 되면서 작성 안해도 되도록 바뀐걸까요? 또,이 부분에서, 여기를 작업해주지 않아도 name 이나 age 둘중 하나만 put 해도, null 값이 들어가지 않는데요.이 역시 버젼이 올라가서 개선이 된걸까요?만약 그렇다면, 개정된 강의를 만드실 계획이 있으신지도 궁금합니다지금 사용하고 있는 몽구스 는 7.0.1 입니다.
-
미해결따라하며 배우는 노드, 리액트 시리즈 - 유튜브 사이트 만들기
해당 오류 해결 방법 좀 알려주세요 ㅠㅠ
위의 오류 해결방법좀 알려주세요 ㅠ
-
미해결mongoDB 기초부터 실무까지(feat. Node.js)
섹션1 - ObjectID
여기 이부분은 ObjectID를 ID 가 아닌 Id 로 해주면 되는 부분이 아닌가요?ObjectId 로 하면 잘 나오는데요. 굳이 ObjectID 로 선언을 해줘야하는가 싶어서 질문드립니다.
-
해결됨[코드캠프] 부트캠프에서 만든 고농축 프론트엔드 코스
apollo-upload-client 설정 시 uploadLink 부분 질문이 있습니다.
강의 명: 이미지 업로드 프로세스 이해 및 실습 시간대: 1시간 1분 35초쯤 해당 부분에서 uploadLink를 넣으실 때 에러가 안뜨시던데저는 위와 같은 타입 에러가 뜹니다. (모든 에러 구문은 마지막 부분에 있습니다)물론 타입스크립트 apollo-client-upload의 타입스크립트 부분도 다운로드 받았습니다.TS 에러라 실제 업로드 기능 테스트에는 문제가 없었지만 저만 에러가 뜨는 것 같아서 찝찝한 마음에 질문을 올려봅니다.버전 차이일까요? (일단 uploadLink 변수 뒤에 any를 붙여주면 컴파일 에러가 사라지긴 했습니다.) 사용 중인 버전{ "name": "class", "version": "0.1.0", "private": true, "scripts": { "dev": "next dev", "build": "next build", "start": "next start", "lint": "next lint", "generate": "graphql-codegen" }, "dependencies": { "@ant-design/icons": "^5.0.1", "@apollo/client": "^3.6.9", "@emotion/react": "^11.10.0", "@emotion/styled": "^11.10.0", "@material-ui/core": "^4.12.4", "@next/font": "13.1.2", "antd": "^4.22.8", "apollo-upload-client": "^17.0.0", "axios": "^0.27.2", "graphql": "^16.6.0", "next": "12.1.0", "react": "17.0.2", "react-daum-postcode": "^3.1.1", "react-dom": "17.0.2", "react-infinite-scroller": "^1.2.6" }, "devDependencies": { "@graphql-codegen/cli": "^3.0.0", "@graphql-codegen/typescript": "^3.0.0", "@types/apollo-upload-client": "^17.0.2", "@types/node": "17.0.2", "@types/react": "17.0.2", "@types/react-infinite-scroller": "^1.2.3", "@typescript-eslint/eslint-plugin": "^5.0.0", "eslint": "^8.0.1", "eslint-config-prettier": "^8.6.0", "eslint-config-standard-with-typescript": "^34.0.0", "eslint-plugin-import": "^2.25.2", "eslint-plugin-n": "^15.0.0", "eslint-plugin-promise": "^6.0.0", "eslint-plugin-react": "^7.32.2", "prettier": "2.8.4", "typescript": "*" }, "resolutions": { "@types/react": "17.0.2" } } 설정 코드에러 내용 전문const uploadLink: ApolloLink'ApolloLink' 형식은 'ApolloLink | RequestHandler' 형식에 할당할 수 없습니다.'import("c:/Users/PC/Desktop/real_project/study/class/node_modules/@types/apollo-upload-client/node_modules/@apollo/client/link/core/ApolloLink").ApolloLink' 형식은 'import("c:/Users/PC/Desktop/real_project/study/class/node_modules/@apollo/client/link/core/ApolloLink").ApolloLink' 형식에 할당할 수 없습니다.'split' 속성의 형식이 호환되지 않습니다.'(test: (op: import("c:/Users/PC/Desktop/real_project/study/class/node_modules/@types/apollo-upload-client/node_modules/@apollo/client/link/core/types").Operation) => boolean, left: import("c:/Users/PC/Desktop/real_project/study/class/node_modules/@types/apollo-upload-client/node_modules/@apollo/client/link/cor...' 형식은 '(test: (op: import("c:/Users/PC/Desktop/real_project/study/class/node_modules/@apollo/client/link/core/types").Operation) => boolean, left: import("c:/Users/PC/Desktop/real_project/study/class/node_modules/@apollo/client/link/core/ApolloLink").ApolloLink | import("c:/Users/PC/Desktop/real_project/study/clas...' 형식에 할당할 수 없습니다.'left' 및 'left' 매개 변수의 형식이 호환되지 않습니다.'import("c:/Users/PC/Desktop/real_project/study/class/node_modules/@apollo/client/link/core/ApolloLink").ApolloLink | import("c:/Users/PC/Desktop/real_project/study/class/node_modules/@apollo/client/link/core/types").RequestHandler' 형식은 'import("c:/Users/PC/Desktop/real_project/study/class/node_modules/@types/apollo-upload-client/node_modules/@apollo/client/link/core/ApolloLink").ApolloLink | import("c:/Users/PC/Desktop/real_project/study/class/node_modules/@types/apollo-upload-client/node_modules/@apollo/client/link/core/types").RequestHandler' 형식에 할당할 수 없습니다.'ApolloLink' 형식은 'ApolloLink | RequestHandler' 형식에 할당할 수 없습니다.'import("c:/Users/PC/Desktop/real_project/study/class/node_modules/@apollo/client/link/core/ApolloLink").ApolloLink' 형식은 'import("c:/Users/PC/Desktop/real_project/study/class/node_modules/@types/apollo-upload-client/node_modules/@apollo/client/link/core/ApolloLink").ApolloLink' 형식에 할당할 수 없습니다.'split' 속성의 형식이 호환되지 않습니다.'(test: (op: import("c:/Users/PC/Desktop/real_project/study/class/node_modules/@apollo/client/link/core/types").Operation) => boolean, left: import("c:/Users/PC/Desktop/real_project/study/class/node_modules/@apollo/client/link/core/ApolloLink").ApolloLink | import("c:/Users/PC/Desktop/real_project/study/clas...' 형식은 '(test: (op: import("c:/Users/PC/Desktop/real_project/study/class/node_modules/@types/apollo-upload-client/node_modules/@apollo/client/link/core/types").Operation) => boolean, left: import("c:/Users/PC/Desktop/real_project/study/class/node_modules/@types/apollo-upload-client/node_modules/@apollo/client/link/cor...' 형식에 할당할 수 없습니다.'right' 및 'right' 매개 변수의 형식이 호환되지 않습니다.'import("c:/Users/PC/Desktop/real_project/study/class/node_modules/@types/apollo-upload-client/node_modules/@apollo/client/link/core/ApolloLink").ApolloLink | import("c:/Users/PC/Desktop/real_project/study/class/node_modules/@types/apollo-upload-client/node_modules/@apollo/client/link/core/types").RequestHandle...' 형식은 'import("c:/Users/PC/Desktop/real_project/study/class/node_modules/@apollo/client/link/core/ApolloLink").ApolloLink | import("c:/Users/PC/Desktop/real_project/study/class/node_modules/@apollo/client/link/core/types").RequestHandler | undefined' 형식에 할당할 수 없습니다.'ApolloLink' 형식은 'ApolloLink | RequestHandler | undefined' 형식에 할당할 수 없습니다.ts(2322) 감사합니다.
-
해결됨[코드캠프] 부트캠프에서 만든 고농축 프론트엔드 코스
try/catch 내 error 관련 질문이 있습니다.
안녕하세요 멘토님, 항상 양질의 강의 잘 듣고 있습니다. 저번에 질문 올리려다 까먹고 못 올렸다가 다시 기억나서 올리는 질문입니다.try/catch 구문에서 error.message는 graphql 에서 예외처리 될 때 보내지는 에러 메시지인지아니면 graphql이 아닌 백단 부분(node 코드) 같은 곳에서 예외처리 되어 보내지는 에러 메시지인지 궁금합니다.수업 때 들은 기억으로는 error 객체가 백엔드에서 보내주는 에러에 대한 정보라고만 들었던 것 같은데, 궁금하여 질문 올립니다. 감사합니다.
-
미해결MERN STACK 커뮤니티 : 시작부터 배포까지 알려주는 React
닉네임 중복검사 시 404 에러
서버 주소도 제대로 전달한 것 같은데 404 에러가 뜨는데 뭐가 잘못된걸까요
-
미해결[개정3판] Node.js 교과서 - 기본부터 프로젝트 실습까지
슬랙방에 들어가지지 않습니다
선생님 안녕하세요슬랙방 링크를 클릭하니 이런 페이지가 뜹니다.
-
미해결따라하며 배우는 노드, 리액트 시리즈 - 레딧 사이트 만들기(NextJS)(Pages Router)
votes기능 부분
- 학습 관련 질문을 남겨주세요. 상세히 작성하면 더 좋아요! - 먼저 유사한 질문이 있었는지 검색해보세요. - 서로 예의를 지키며 존중하는 문화를 만들어가요. - 잠깐! 인프런 서비스 운영 관련 문의는 1:1 문의하기를 이용해주세요.1.위 이미지처럼 comments.votes를 했는데 저렇게 Array만 뜨는데 값을 가져올 수 있는 건가요?? 위 이미지 처럼 postId와 commentID를 넣은게 아닌 comment 객체와 Post 객체를 넣었는데 어떻게 DB에는 postID와 CommentId가 들어간건지 알 수 있을까요??
-
해결됨[코드캠프] 부트캠프에서 만든 고농축 프론트엔드 코스
GraphQL $boardId: ID! 오류
안녕하세요! 강의듣는데 혼자서는 오류를 해결하지 못 할것 같아서 질문드립니다!오류뜨는 부분은 freeboard_frontend > boards > [_id] > index.js (상세페이지) 입니다. 글 작성 -> 상세페이지로 이동 -> 상세페이지에서 수정 버튼 누르면 수정페이지로 이동 -> 수정페이지에서 수정하고 수정버튼 누르면 다시 상세페이지로 이동 > 상세페이지에서 삭제버튼 클릭하면 삭제후 리스트로 이동제가 의도한 기능들은 모두 정상작동은 하는데 상세페이지에만 접속하면 해당 오류가 발생합니다..! (상세페이지 query 코드입니다) -> $boardID: ID! 이부분에서 오류가 나는것 같은데 강의 자료실에 올라온 코드와 비교해봤지만 같게 작성된걸 확인했습니다! (상세페이지 접속했을때만 NetWork에 이렇게 뜹니다ㅠㅠ) 한가지 더 궁금한 점이 있습니다!타입 지정해줄때 Docs 보고 그대로 적으면 된다고 하셨는데 ($boardId: [ID!]!) 이렇게 적으니까 오류가 나서 ($boardId: ID!) 이렇게 적으니까 작동이되더라구요.. 제가 강의 들으면서 빼먹은 부분이 있는걸까요ㅠㅠ?이럴땐 어떻게 적어야 할까요ㅠ??export const DELETE_BOARD = gql` mutation deleteBoard($boardId: ID!){ deleteBoard (boardId: $boardId) } `;
-
미해결쿠버네티스 101 - 클라우드/서버 개발 첫걸음
개발 환경에 소개해주신 것들은 직접 설치 하라는 의미인건가요?
개발 환경 강의에서 VS 에서 Google Cloud Code 이외 설치 영상은 없는데처음에 소개해줄 때 알아서 설치하라는 말씀이신가요? Google Cloud Code 익스텐션 설치 후 where.exe minicube 입력 시정보: 제공된 패턴에 해당되는 파일을 찾지 못했습니다.라고 떠서요.
-
해결됨한 입 크기로 잘라 먹는 리액트(React.js) : 기초부터 실전까지
코드 샌드박스처럼 코드를 받을 수 있나요?
섹션6 페이지구현-홈 수강중인데제가 코드 쳤을때18:29 오늘의일기1~5가 아에 안 나타나서 프롭으로 빈배열로 보내도안보여서 18분까지 다시 3번 들었는데ㅠㅠ 제가 실수한 곳을 아무리 찾아봐도 안보여서혹시 코드를 따로 받을 수 있을까요???
-
미해결MERN STACK 커뮤니티 : 시작부터 배포까지 알려주는 React
수정 버튼 눌렀을 때 이전 이미지 경로
const [Image, setImage] = useState(PostInfo.image); <ImageUpload Image={Image} /> 이처럼 state값에 PostInfo.image를 해주어서 이미지 경로 값을 지정해주고 props로 넘긴 뒤 <Form.Control type="file"accept="image/*"src={props.Image}onChange={(e) => FileUpload(e)}/>이런식으로 해주었는데 안떠서 그런데 어떤식으로 해야 수정할 때 이전의 이미지 경로가 뜨게 될까요 ??
-
미해결따라하며 배우는 노드, 리액트 시리즈 - 레딧 사이트 만들기(NextJS)(Pages Router)
GET http://localhost:4000/images/null 404 (Not Found)
안녕하세요.이미지 업로드 부분을 다 작성하고 이미지까지 잘 올라가지는데console을 보니null:1 GET http://localhost:4000/images/null 404 (Not Found)이런 오류가 뜨는데 무시해도 상관 없는건가요?
-
해결됨[코드캠프] 부트캠프에서 만든 고농축 백엔드 코스
N:M tag 부분 구현 중 findOne 조회 부분 에러
products.service.ts에서 create 부근에 tag를 저장 하기 전 tag를 미리 조회하는 부분을 구현 중인데 findOne에서 {name: tagname} 을 구현하려고 할 때 다음과 같은 에러가 발생합니다. save에서는 에러가 발생하지 않는데 findOne 조회 부분만 에러가 발생하네요관련된 코드 같이 보내드립니다.createProduct.input.tsimport { InputType, Field, Int } from '@nestjs/graphql'; import { Min } from 'class-validator'; import { ProductSaleslocationInput } from 'src/apis/productsSaleslocation/entities/dto/productSaleslocation.input'; @InputType() export class CreateProductInput { @Field(() => String) name: string; @Field(() => String) description: string; @Min(0) @Field(() => Int) price: number; @Field(() => ProductSaleslocationInput) productSaleslocation: ProductSaleslocationInput; @Field(() => String) productCategotyId: string; @Field(() => [String]) productTags: string[]; } products.entity.tsimport { Field, Int, ObjectType } from '@nestjs/graphql'; import { ProductCategory } from 'src/apis/productsCategory/entities/productsCategory.entity'; import { ProductTag } from 'src/apis/productsTags/productTags.entity'; import { User } from 'src/apis/users/users.entity'; import { Column, DeleteDateColumn, Entity, JoinColumn, JoinTable, ManyToMany, ManyToOne, OneToOne, PrimaryGeneratedColumn, } from 'typeorm'; import { ProductSaleslocation } from '../../productsSaleslocation/entities/productsSaleslocation.entity'; @Entity() @ObjectType() export class Product { @PrimaryGeneratedColumn('uuid') @Field(() => String) id: string; @Field(() => String) @Column() name: string; @Field(() => String) @Column() description: string; @Field(() => Int) @Column() price: number; @Field(() => Boolean) @Column({ default: false }) isSoldout: boolean; @DeleteDateColumn() deletedAt: Date; @Field(() => ProductSaleslocation) @JoinColumn() @OneToOne(() => ProductSaleslocation) productSaleslocation: ProductSaleslocation; @Field(() => ProductCategory) @ManyToOne(() => ProductCategory) productCategory: ProductCategory; @Field(() => User) @ManyToOne(() => User) user: User; @JoinTable() @ManyToMany(() => ProductTag, (productTags) => productTags.products) @Field(() => [ProductTag]) productTags: ProductTag[]; } productTags.entity.tsimport { Field, ObjectType } from '@nestjs/graphql'; import { Column, Entity, ManyToMany, PrimaryGeneratedColumn } from 'typeorm'; import { Product } from '../products/entities/products.entity'; @Entity() @ObjectType() export class ProductTag { @Field(() => String) @PrimaryGeneratedColumn('uuid') id: string; @Column() @Field(() => String) name: string; @Field(() => [Product]) @ManyToMany(() => Product, (products) => products.productTags) products: Product[]; } products.service.tsimport { Product } from './entities/products.entity'; import { Injectable, UnprocessableEntityException } from '@nestjs/common'; import { Repository } from 'typeorm'; import { InjectRepository } from '@nestjs/typeorm'; import { ProductSaleslocation } from '../productsSaleslocation/entities/productsSaleslocation.entity'; import { ProductTag } from '../productsTags/productTags.entity'; @Injectable() export class ProductService { constructor( @InjectRepository(Product) private readonly productRepository: Repository<Product>, @InjectRepository(ProductSaleslocation) private readonly productSaleslocationRepository: Repository<ProductSaleslocation>, @InjectRepository(ProductTag) private readonly productTagRepository: Repository<ProductTag>, ) {} async findAll() { return await this.productRepository.find({ relations: ['productSaleslocation', 'productCategory', 'productTags'], }); } async findOne({ productId }) { return await this.productRepository.findOne({ where: { id: productId }, relations: ['productSaleslocation', 'productCategory', 'productTags'], }); } async create({ createProductInput }) { // 1. 상품만 등록하는 경우 // const result = await this.productRepository.save({ // ...createProductInput, // // 하나 하나 직접 나열하는 방식 // // name: createProductInput.name, // // description: createProductInput.description, // // price: createProductInput.price, // }); // 2. 상품과 상품거래 위치 같이 등록 const { productSaleslocation, productCategotyId, productTag, ...product } = createProductInput; const result = await this.productSaleslocationRepository.save({ ...productSaleslocation, }); // productTag // ["#electronics, #computer"] const result2 = []; // [{name: ..., id: ...}] for (let i = 0; i < productTags.length; i++) { const tagName = productTags[i].replace('#', ''); // check the tags that has already registered const checkTag = await this.productTagRepository.findOne({ name: tagName, }); // if the tags has been existed if (checkTag) { result2.push(checkTag); // if the tags hasn't been existed } else { const newTag = await this.productTagRepository.save({ name: tagName }); result2.push(newTag); } } const result3 = await this.productRepository.save({ ...product, productSaleslocation: result, // result 통째로 넣기 vs id만 넣기 productCategory: { id: productCategotyId }, productTags: result2, }); return result3; } async update({ productId, updateProductInput }) { const myProduct = await this.productRepository.findOne({ where: { id: productId }, }); const newProduct = { ...myProduct, id: productId, ...updateProductInput, }; return await this.productRepository.save(newProduct); } async checkSoldOut({ productId }) { const product = await this.productRepository.findOne({ where: { id: productId }, }); if (product.isSoldout) { throw new UnprocessableEntityException('Sold out'); } // if(product.isSoldout) { // throw new HttpException('이미 판매 완료 된 상품입니다.', HttpStatus.UNPROCESSABLE_ENTITY) // } } async delete({ productId }) { // 1. 실제 삭제 // const result = await this.productRepository.delete({ id: productId }); // return result.affected ? true : false // 2. 소프트 삭제(직접 구현) - isDeleted // this.productRepository.update({ id: productId }, { isDeleted: true }); // 3. 소프트 삭제(직접 구현) - deletedAt // this.productRepository.update({ id: productId }, { deletedAt: new Date() }); // 4. 소프트 삭제(TypeORM 제공) - softRemove - id로만 삭제 가능 // this.productRepository.softRemove({ id: productId }); // 4 . 소프트 삭제(TypeORM 제공) - softDelete const result = await this.productRepository.softDelete({ id: productId }); return result.affected ? true : false; } } 내용 확인 부탁드립니다.
-
해결됨[코드캠프] 부트캠프에서 만든 고농축 백엔드 코스
안녕하세요 질문있습니다!
@ObjectType이랑 @EntryType이랑 같이 사용을 할수는 없는건가요??dto와 entry가 다른부분이 없어서 같이 쓰는게 낫겠다싶어서 시도하려니 안되네요확실히 역할을 나눠야하는건가요??
-
미해결따라하며 배우는 노드, 리액트 시리즈 - 레딧 사이트 만들기(NextJS)(Pages Router)
댓글 리스트 불러오는 핸들러에서
- 학습 관련 질문을 남겨주세요. 상세히 작성하면 더 좋아요! - 먼저 유사한 질문이 있었는지 검색해보세요. - 서로 예의를 지키며 존중하는 문화를 만들어가요. - 잠깐! 인프런 서비스 운영 관련 문의는 1:1 문의하기를 이용해주세요. 이 부분에서 Comment DB에 postID가 언제 저장된 것일까요??댓글 생성 부분에서는 Post 정보만 저장하지 않았나요?? Post정보를 저장하면 postId가 자동저장되는건가요??댓글을 생성하면 해당 댓글의 postId는 Null값이 아닌가요?
-
미해결[리뉴얼] React로 NodeBird SNS 만들기
express redirect
client 주소: http://localhost:3000server 주소: http://localhost:5000현재 저는 쿠키 공유 잘 되며 글 작성도 잘 됩니다. 그런데 client에서 server로 요청을 보내고 요건에 부합하지 않으면 client측 화면을 redirect 시키려는데 cors 오류가 발생합니다. 어떤부분을 보면 좋을까요?server에서 redirect 주소는 http://localhost:3000/login 이런식으로 client 주소 작성했습니다.추가적으로 client 측에서 router.push로 서버 주소로 요청보내고 로직 수행 후 응답 결과로 res.redirect는 cors 오류 없이 잘 동작합니다. 이건 또 왜 잘 되는걸까요.?