46,200원
다른 수강생들이 자주 물어보는 질문이 궁금하신가요?
- 미해결탄탄한 백엔드 NestJS, 기초부터 심화까지
error_code : Property 'user' does not exist on type 'Request<ParamsDictionary, any, any, ParsedQs, Record<string, any>>'.ts(2339)
안녕하세요! 저와 같은 수강생 여러분, 반갑습니다.분명 저와 같은 에러를 겪고 분투하는 사람을 위해서 제 경험을 공유 드립니다. 저 같은 경우 선생님 코드를 그대로 따라 진행을 했었는데요.특히나 CustomDecoration 부분에 있어서 그대로 따라 진행을 했습니다. 정확히 이 부분에서 에러가 발생을 하더라구요.return request.user as CatCurrentDto; 에러의 내용은 아래와 같습니다.Property 'user' does not exist on type 'Request<ParamsDictionary, any, any, ParsedQs, Record<string, any>>'.ts(2339) 해결방안은 선생님이 보여주신 nestJS의 공식문서를 참고해서 다시 적어보았는데요. Request를 제거해주시면 저 부분이 잡힙니다. 버전이 자꾸 바뀌기때문에 매개변수, 메소드, 각각의 요구되는 필드값 또한 바뀌는것 같습니다. 무언가 잘 안될때는 제공해주신 공식문서 찾는것도 좋은 방법인거 같습니다. 저와 같은 에러를 만나신분에게 조금이나마 도움이 되었음좋겠습니다. 아래는 전체 로직 입니다. [user.decorator.ts] -> 제공된 소스코드 수정한 코드import { CatCurrentDto } from './../../cats/dto/cats.current.dto'; import { createParamDecorator, ExecutionContext } from '@nestjs/common'; export const CurrentUser = createParamDecorator( (data: unknown, ctx: ExecutionContext) => { const request = ctx.switchToHttp().getRequest(); return request.user as CatCurrentDto; }, ); [user.decorator.ts] -> 제공된 소스코드import { CatCurrentDto } from './../../cats/dto/cats.current.dto'; import { Request } from 'express'; import { Cat } from '../../cats/cats.schema'; import { createParamDecorator, ExecutionContext } from '@nestjs/common'; export const CurrentUser = createParamDecorator( (data: unknown, ctx: ExecutionContext) => { const request: Request = ctx.switchToHttp().getRequest(); return request.user as CatCurrentDto; }, );
- 미해결탄탄한 백엔드 NestJS, 기초부터 심화까지
jwt를 따로 연습하고 있는데 env를 못읽는 것 같습니다.
import { Module } from '@nestjs/common'; import { AuthController } from './auth.controller'; import { AuthService } from './auth.service'; import { ConfigModule } from '@nestjs/config'; import { PassportModule } from '@nestjs/passport'; import { JwtModule } from '@nestjs/jwt'; import { JwtStrategy } from 'src/auth/jwt/jwt.strategy'; @Module({ imports: [ ConfigModule.forRoot({ isGlobal: true, envFilePath: `.env.${process.env.NODE_ENV}`, }), PassportModule.register({ defaultStrategy: 'jwt', session: false }), JwtModule.register({ secret: process.env.JWT_SECRET, signOptions: { expiresIn: '1y' }, }), ], controllers: [AuthController], providers: [AuthService, JwtStrategy], }) export class AuthModule {}이게 auth.module.ts 파일입니다import { Injectable } from '@nestjs/common'; import { PassportStrategy } from '@nestjs/passport'; import { ExtractJwt, Strategy } from 'passport-jwt'; @Injectable() export class JwtStrategy extends PassportStrategy(Strategy) { constructor() { super({ jwtFromRequest: ExtractJwt.fromAuthHeaderAsBearerToken(), ignoreExpiration: false, secretOrKey: process.env.JWT_SECRET, }); } async validate() {} }여기서 문제가 일어났습니다. process.env.JWT_SECRET 이 것을 읽지 못합니다.NODE_ENV="development" JWT_SECRET="secret" PORT=8000.env.development 파일도 root폴더에 잘 있습니다. 무엇이 문제인지 잘 모르겠습니다
- 미해결탄탄한 백엔드 NestJS, 기초부터 심화까지
Ec2로 안하시는 이유가 있을까요?
Ec2로 안하시는 이유가 있을까요?
- 미해결탄탄한 백엔드 NestJS, 기초부터 심화까지
ERROR [ExceptionsHandler] this.validate is not a function 무슨 에러일까요 ㅠ
안녕하세요 postman에서 login 요청을 보내려고 할때 터미널에서 ERROR [ExceptionsHandler] this.validate is not a function 라고 오류가 납니다 validate를 함수로 작성해주었는데 이러한 오류가 나서 어떻게 해결해야 할지 고민입니다.
- 미해결탄탄한 백엔드 NestJS, 기초부터 심화까지
tsc compile 관련 질문
1. tsc로 compile하고 난 후 지정된 경로 저장을 하였을 때기존 ts파일과 compile된 js파일문아니라 js.map 이라는 파일이 함께 생성됩니다. js.map 이라는 파일은 어떤 파일인지 여쭤보고 싶습니다 npm run start:dev 로 실행했을 경우 import * as express from 'express'; import { Cat, CatType } from './app.model'; const app:express.Express = express(); const data = [1,2,3,4,5,6,7,8,9,10]; app.get('/',(req:express.Request,res:express.Response) => { // res.send({data}); res.send({ cats:Cat }); }); app.listen(8000, () => { console.log('Server is running on port 8000'); }) 위처럼 실행한 후res.send({data}) 의 주석을 풀면 오류가 발생하고중단 후 재실행하면 정상작동합니다.tsc-watch --onSuccess \"node dist/app.js\"위 script가 nodemon처럼 안정화가 되지 않아서 발생하는 오류인가요?
- 미해결탄탄한 백엔드 NestJS, 기초부터 심화까지
lightSail배포와 https port 소켓이슈!!!
안녕하세요! 선생님!선생님의 강의를듣고nest프로젝트를 lightsail에 배포성공하였습니다.헌데 별도의 인증서를 적용해주지 않으면http 프로토콜로 api서버가 만들어져서https를 적용하기위해 인증서를 발급받고적용하니 https로도 서버를 접근할수있게되었습니다. 근데 여기서 문제가 생겼습니다.저는 nest 프로젝트에서서버는 80 포트를 열고소켓은 8181포트를 열었습니다. lightsail에서 방화벽으로http 80https 443 으로 등록해놓았기때문에 프로젝트에서서버가 80번포트로 열렸던것은 문제가 되지 않았으나프로젝트에서소켓이 8181번포트로 열어놓았던것은cors문제가 생겨 소켓연결이 안되더라구요 그래서 lightsail에서https로 8181 등록해주면되는건가?했는데 https로 8181등록되지 않아서 custom으로 8181포트를 열어주면 되는건가?싶어서 8181포트도 방화벽에서 열어주었는데http에서만 8181포트가 open되는거지https에서는 8181포트가 여전히 허용되지 않더라구요ㅜㅜ 어찌하면 이문제를 해결할수있을까요? 참고로현재 프론트 프로젝트를 amplify에 호스팅해놓아서프론트웹서버의 static ip를 알수없는상황입니다!!
- 미해결탄탄한 백엔드 NestJS, 기초부터 심화까지
ValidationPipe DTO 변환 대신 JS Object 로 변환되는 이유
DTO 변환이 잘 되다가 다른 테스트 케이스 작성중에 아래 처럼 SignInUserRequest DTO 로 변환이 안되는 경우를 겪었습니다. ValidationPipe 옵션 transform: true 임에도 불구하고, 이런 현상이 일어나는 이유를 알 수 있을까요?아래는 잘되는 경우입니다.읽어주셔서 감사합니다.
- 미해결탄탄한 백엔드 NestJS, 기초부터 심화까지
nestjs typeorm 에서 mariadb 고가용성 galera cluster 적용 관련
nestjs 좋은 강의 잘 들었습니다.~ 감사합니다.다만 질문이 있습니다.기존코드를 nestjs로 마이그레이션 하고 있습니다.mariadb 고가용성 적용을 해야됩니다. 구글링을 해도 해당 관련한 자료가 별로 없어서 질문드립니다.typeorm type을 보면 replication으론 mater, salves 필드로 고가용성이 지원되는데 cluster 구조로 지원이 되는게 맞는지 알고 싶습니다.아직 응용은 못하는 단계라서 질문 드립니다.만약 typeorm에서 cluster 지원이 되지 않는다면 어떤 방법으로 할 수 있나요?
- 미해결탄탄한 백엔드 NestJS, 기초부터 심화까지
Auth 모듈에서 JwtAuthGuard 가 아닌, JwtStrategy 를 provider 하는 이유?
import { Module, forwardRef } from '@nestjs/common'; import { AuthService } from './auth.service'; import { PassportModule } from '@nestjs/passport'; import { JwtModule } from '@nestjs/jwt'; import { CatsModule } from 'src/cats/cats.module'; import { JwtStrategy } from './jwt/jwt.strategy'; @Module({ imports: [ PassportModule.register({ defaultStrategy: 'jwt', session: false }), JwtModule.register({ secret: 'secret', signOptions: { expiresIn: '1y' }, }), forwardRef(() => CatsModule), ], providers: [AuthService, JwtStrategy], exports: [AuthService], }) export class AuthModule {} auth.module.ts 에서 JwtAuthGuard를 provider 에 추가하지 않고, JwtStrategy를 제공하는 이유가 궁금합니다. 실제로 Cat controller 에서는 authService의 JwtAuthGuard를 통해 호출되는거 아닌가요? JwtAuthGuard & JwtStrategy 둘다 provider 에 추가하라고 하면 그것대로 이해가 되는데, JwtStrategy만 추가하는게 이해가 잘 안되어서요ㅠㅠ
- 미해결탄탄한 백엔드 NestJS, 기초부터 심화까지
Schema에서 DTO로 상속하는 과정에서 Decorator와 required 초기화 관련 질문입니다.
안녕하세요, 강의에서는 Cat 클래스에서 정의한 스키마를 이용해 requestDTO, responseDTO 등으로 상속해서 확장하셨습니다. 검색해보니 이때 원래 파일에 있던 Decorator 등의 메타데이터는 그대로 남아있다고 하는데요, Response 상황에서 어차피 Validation이나 API Property 같은 내용을 신경쓰지 않아도 되니까 상속해도 별 문제가 없긴할거고 강의에서도 그 부분은 크게 신경쓰지 않으신것 같습니다. 혹시 현업에서나 개발 과정에서 저렇게 PickType으로 기존 클래스를 재사용하는 과정에서 기존 클래스에 있던 여러 Decorator 들을 초기화하고 다시 세팅하려면 어떻게 해야할까요? PartialType으로 래핑하는 방법을 사용하면 required 필드는 사라집니다.상속을 하니까 API 문서에 표시되는 순서가 id가 가장 나중에 표시가 됩니다. 순서를 바꾸는 방법을 찾지못했는데 방법이 있을까요?그래서 저는 아예 schema 파일에 id까지 넣은 후에 PickType에서 id 까지 가져오는 방법을 사용해봤습니다.
- 미해결탄탄한 백엔드 NestJS, 기초부터 심화까지
[건의사항] tsc 패키지가 더 이상 관리되지않아(deprecated) 디펜던시에서 삭제하는 것이 어떨까 싶습니다.
[건의사항] tsc 패키지가 더 이상 관리되지않아(deprecated) package.json의 디펜던시에서 삭제하는 것이 어떨까 싶습니다.
- 해결됨탄탄한 백엔드 NestJS, 기초부터 심화까지
AlreadyHasActiveConnectionError 에러 발생
에러 해결하였습니다..app.module.ts > typeOrmModuleOptions에keepConnectionAlive: true 옵션이 빠져있어 발생한 에러였습니다. 검색해보니 '어플리케이션 종료 시 DB 연결 유지'에 대한 내용인데제가 다른 옵션과 착각하고 주석 처리했었습니다. 현재 옵션 활성화 하였고 e2e 테스트 정상적으로 진행되는거 확인했습니다.const typeOrmModuleOptions = { useFactory: async ( configService: ConfigService, ): Promise<TypeOrmModuleOptions> => ({ namingStrategy: new SnakeNamingStrategy(), // ... keepConnectionAlive: true, }), 검색해보니 beforeEach에 있는 app.init() 메소드에서 어플리케이션을 초기화하며 DB 연결도 초기화되는데,어플리케이션을 재초기화하는 것이지 종료한 적은 없었기에 여전히 'default'라는 이름으로 활성화된 DB 연결이 존재하였고,DB 연결 재초기화 중 'default라는 이름으로 새로운 DB 연결이 실패하였다' 에러가 발생한 것이며 keepConnectionAlive: true 옵션을 줌으로써DB 연결은 어플리케이션의 생명주기와는 별도로 존재하게 되고, 이미 활성화된 DB 연결이 존재하므로 새로운 DB 연결을 시도하지 않는다 라고 합니다..공부가 되었네요. app.e2e-spec.ts의 afterEach 메소드는 제거하였습니다. ============================================================= 안녕하세요 강사님강의따라 진행하다 에러가 발생하여 질문글 남깁니다. 에러 메세지는 아래와 같습니다.[Nest] 26544 - 2023. 11. 25. 오후 11:01:36 ERROR [TypeOrmModule] Unable to connect to the database. Retrying (1)... AlreadyHasActiveConnectionError: Cannot create a new connection named "default", because connection with such name already exist and it now has an active connection session. at AlreadyHasActiveConnectionError.TypeORMError [as constructor] (C:\Users\admin\OneDrive\바탕 화면\typeorm-in-the-nest\src\error\TypeORMError.ts:7:9) at new AlreadyHasActiveConnectionError (C:\Users\admin\OneDrive\바탕 화면\typeorm-in-the-nest\src\error\AlreadyHasActiveConnectionError.ts:8:9) at ConnectionManager.Object.<anonymous>.ConnectionManager.create (C:\Users\admin\OneDrive\바탕 화면\typeorm-in-the-nest\src\connection\ConnectionManager.ts:57:23) at C:\Users\admin\OneDrive\바탕 화면\typeorm-in-the-nest\src\globals.ts:77:35 at step (C:\Users\admin\OneDrive\바탕 화면\typeorm-in-the-nest\node_modules\tslib\tslib.js:143:27) at Object.next (C:\Users\admin\OneDrive\바탕 화면\typeorm-in-the-nest\node_modules\tslib\tslib.js:124:57) at C:\Users\admin\OneDrive\바탕 화면\typeorm-in-the-nest\node_modules\tslib\tslib.js:117:75 at new Promise (<anonymous>) at Object.__awaiter (C:\Users\admin\OneDrive\바탕 화면\typeorm-in-the-nest\node_modules\tslib\tslib.js:113:16) at createConnection (C:\Users\admin\OneDrive\바탕 화면\typeorm-in-the-nest\node_modules\typeorm\globals.js:55:20) [Nest] 26544 - 2023. 11. 25. 오후 11:01:39 ERROR [TypeOrmModule] Unable to connect to the database. Retrying (2)... AlreadyHasActiveConnectionError: Cannot create a new connection named "default", because connection with such name already exist and it now has an active connection session. at AlreadyHasActiveConnectionError.TypeORMError [as constructor] (C:\Users\admin\OneDrive\바탕 화면\typeorm-in-the-nest\src\error\TypeORMError.ts:7:9) at new AlreadyHasActiveConnectionError (C:\Users\admin\OneDrive\바탕 화면\typeorm-in-the-nest\src\error\AlreadyHasActiveConnectionError.ts:8:9) at ConnectionManager.Object.<anonymous>.ConnectionManager.create (C:\Users\admin\OneDrive\바탕 화면\typeorm-in-the-nest\src\connection\ConnectionManager.ts:57:23) at C:\Users\admin\OneDrive\바탕 화면\typeorm-in-the-nest\src\globals.ts:77:35 at step (C:\Users\admin\OneDrive\바탕 화면\typeorm-in-the-nest\node_modules\tslib\tslib.js:143:27) at Object.next (C:\Users\admin\OneDrive\바탕 화면\typeorm-in-the-nest\node_modules\tslib\tslib.js:124:57) at C:\Users\admin\OneDrive\바탕 화면\typeorm-in-the-nest\node_modules\tslib\tslib.js:117:75 at new Promise (<anonymous>) at Object.__awaiter (C:\Users\admin\OneDrive\바탕 화면\typeorm-in-the-nest\node_modules\tslib\tslib.js:113:16) at createConnection (C:\Users\admin\OneDrive\바탕 화면\typeorm-in-the-nest\node_modules\typeorm\globals.js:55:20) FAIL test/app.e2e-spec.ts (10.952 s) AppController (e2e) √ / (GET) (845 ms) hello jest × two plus two is four (5014 ms) ● AppController (e2e) › hello jest › two plus two is four thrown: "Exceeded timeout of 5000 ms for a hook. Use jest.setTimeout(newTimeout) to increase the timeout value, if this is a long-running test." 7 | let app: INestApplication; 8 | > 9 | beforeEach(async () => { | ^ 10 | const moduleFixture: TestingModule = await Test.createTestingModule({ 11 | imports: [AppModule], 12 | }).compile(); at app.e2e-spec.ts:9:3 at Object.<anonymous> (app.e2e-spec.ts:6:1) Test Suites: 1 failed, 1 total Tests: 1 failed, 1 passed, 2 total Snapshots: 0 total Time: 11.106 s Ran all test suites. Jest did not exit one second after the test run has completed. This usually means that there are asynchronous operations that weren't stopped in your tests. Consider running Jest with `--detectOpenHandles` to troubleshoot 읽어보니 이미 'default'라는 이름의 연결이 존재하고, 현재 활성화 중이므로 같은 이름의 연결을 또 생성할 수 없다는 것 같고,검색해보니 beforeEach 메소드 안에 Test.createTestingModule이 매 테스트마다 DB 연결을 시도하는 상황이라고 나왔습니다.. 하여 아래와 같이 afterEach 메소드를 사용하여 매 테스트마다 어플리케이션을 종료해주도록 코드를 수정하였습니다.describe('AppController (e2e)', () => { let app: INestApplication; beforeEach(async () => { const moduleFixture: TestingModule = await Test.createTestingModule({ imports: [AppModule], }).compile(); app = moduleFixture.createNestApplication(); await app.init(); }); // 테스트 2개 이상 사용할 경우 필요한 메소드 afterEach(async () => { await app.close(); }); it('/ (GET)', () => { return request(app.getHttpServer()) .get('/') .expect(200) .expect('typeorm in nest, just coding'); }); describe('hello jest', () => { it('two plus two is four', () => { expect(2 + 2).toBe(4); }); }); // 생략 수정 후 강의에서 진행했던 내용은 모두 완료가 되었는데..이제 궁금한 점은강사님과 코드 내용이 같고 도커나 DB 연결에 대하여 특별히 수정한 내용이 없는데왜 이런 상황이 발생하는 것인지. 버전이 달라 발생한 상황인 것인지.. 그리고 afterEach를 사용하였을때 당장 테스트 진행은 가능하지만 이대로 사용해도 괜찮을지 안좋은 것은 아닌지가 궁금합니다..
- 미해결탄탄한 백엔드 NestJS, 기초부터 심화까지
AWS-SDK를 사용하여 S3에 이미지를 저장할때 이 경로를 DB에 저장하려면 어떻게 해야하나요?
강의 따라 진행하며 프론트엔드에서 Image Upload 버튼을 눌러서 이미지를 선택하였을때AWS S3에 저장되는 것까지는 확인이 되었습니다. 다만 DB에서는 기존 이미지 경로 그대로여서 업데이트한 이미지가 적용되지 않고 있는데, 여기서는 어떻게 진행하면 좋을까요? S3 사용 전에는 cats.repository에서 save 메소드 사용하여 새로 갱신된 이미지 파일 경로를 저장하는 과정이 있었듯이async findByIdAndUpdateImg(id: string, fileName: string) { const cat = await this.catModel.findById(id); cat.imgUrl = fileName; const newCat = await cat.save(); // DB에 내용 저장 console.log(newCat); return newCat.readOnlyData; } aws.service의 S3 저장하는 구간 중간에 db에 저장하는 과정을 추가해주면 될 것 같은데..언어 실력이 부족하여 어떻게 시도를 해야할지 감이 잡히질 않습니다.async uploadFileToS3( folder: string, file: Express.Multer.File, ): Promise<{ key: string; s3Object: PromiseResult<AWS.S3.PutObjectAclOutput, AWS.AWSError>; contentType: string; }> { try { const key = `${folder}/${Date.now()}_${path.basename( file.originalname, )}`.replace(/ /g, ''); const s3Object = await this.awsS3 .putObject({ Bucket: this.S3_BUCKET_NAME, Key: key, Body: file.buffer, ACL: 'public-read', ContentType: file.mimetype, }) .promise(); return { key, s3Object, contentType: file.mimetype }; } catch (error) { throw new BadRequestException(`File upload failed : ${error}`); } } 조언 부탁드립니다..
- 미해결탄탄한 백엔드 NestJS, 기초부터 심화까지
401, Unauthorized가 뜹니다. 혹시 다른 분들은 잘되시나요?
프론트엔드에서 진행할 때는 이런 이상이 없었습니다 postman으로 로그인 했고, 바탕화면에서 바로 이미지 업로드하려고 하니'This file isn't in your working directory' 라는 에러가 나와서 구글링하니포스트맨으로 이미지 업로드하려면 지정된 경로에서 업로드해야한다고 하더라구요.포스트맨 설정에서 경로 찾아서 C:\Users\admin\Postman\files에 업로드할 이미지 넣고, 다시 로그인 한 다음 강의대로 진행하니 아래 사진과 같이 나옵니다Unauthorized이니 jwt와 컨트롤러 이미지 업로드 api의 JwtAuthGuard 부분이 문제라고 생각되는데..어떻게 확인을 해보면 될까요? 조언 부탁드립니다.
- 미해결탄탄한 백엔드 NestJS, 기초부터 심화까지
findCatByIdWithoutPassword 함수 리턴 타입 질문
async findCatByIdWithoutPassword(id: string): Promise<Cat | null> { const cat = await this.catModel.findById(id).select('-password'); return cat; } 위 함수에서 Pomise의 반환값이 Cat 또는 null인데 cat은 password가 없는 Cat이라서 Cat이라고 할 수 없는데 return을 cat으로 해도 에러가 안나는 이유를 알고 싶습니디.
- 미해결탄탄한 백엔드 NestJS, 기초부터 심화까지
프론트엔드 코드 실행시 에러가 발생합니다.
>> 갱신, 2023. 10. 06해결했습니다.https://github.com/amamov/teaching-nestjs-a-to-z/tree/frontend위 링크 설명 따라 nestjs root 디렉토리에서 git clone 받고,npm install, npm run dev 하니까 잘 실행되네요$ npm run dev > frontend@0.1.0 dev > next start ready - started server on 0.0.0.0:3000, url: http://localhost:3000 info - Loaded env from C:\Users\admin\OneDrive\바탕 화면\learning_NestJS\frontend\.env 잘못된 파일을 받았던것 같습니다..어느 질문글에서 본 링크 따라서 들어가서 받았던거로 기억하는데..어느 글이었는지 다시 찾아도 보이지 않네요.. >> 질문글, 2023. 10. 04학습자료 frontend를 다운 받았고, 이 폴더를 05 NestJS 실전 프로젝트와 같은 위치에 두었습니다.이후 프론트엔드 코드 실행 방법 강의를 보고frontend 디렉토리로 들어가 npm i를 입력하였습니다admin@DESKTOP-ALLM3V0 MINGW64 ~/OneDrive/바탕 화면/learning_NestJS/frontend (master) $ npm i npm WARN old lockfile npm WARN old lockfile The package-lock.json file was created with an old version of npm, npm WARN old lockfile so supplemental metadata must be fetched from the registry. npm WARN old lockfile npm WARN old lockfile This is a one-time fix-up, please be patient... npm WARN old lockfile npm WARN deprecated @types/antd@1.0.0: This is a stub types definition for antd (https://github.com/ant-design/ant-design). antd provides its own type definitions, so you don't need @types/antd installed! npm WARN deprecated @types/axios@0.14.0: This is a stub types definition for axios (https://github.com/mzabriskie/axios). axios provides its own type definitions, so you don't need @types/axios installed! npm WARN deprecated querystring@0.2.1: The querystring API is considered Legacy. new code should use the URLSearchParams API instead. npm WARN deprecated querystring@0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead. added 368 packages, and audited 369 packages in 24s 48 packages are looking for funding run `npm fund` for details 15 vulnerabilities (3 moderate, 7 high, 5 critical) To address issues that do not require attention, run: npm audit fix To address all issues (including breaking changes), run: npm audit fix --force Run `npm audit` for details.위와 같이 경고 메세지가 나왔고... 이 상태에서 npm run dev를 입력하였더니admin@DESKTOP-ALLM3V0 MINGW64 ~/OneDrive/바탕 화면/learning_NestJS/frontend (master) $ npm run dev > frontend@0.1.0 dev > next dev ready - started server on 0.0.0.0:3000, url: http://localhost:3000 info - Loaded env from C:\Users\admin\OneDrive\바탕 화면\learning_NestJS\frontend\.env info - Using webpack 5. Reason: no next.config.js https://nextjs.org/docs/messages/webpack5 Error: error:0308010C:digital envelope routines::unsupported at new Hash (node:internal/crypto/hash:71:19) at Object.createHash (node:crypto:133:10) at BulkUpdateDecorator.hashFactory (C:\Users\admin\OneDrive\바탕 화면\learning_NestJS\frontend\node_modules\next\dist\compiled\webpack\bundle5.js:133790:18) at BulkUpdateDecorator.update (C:\Users\admin\OneDrive\바탕 화면\learning_NestJS\frontend\node_modules\next\dist\compiled\webpack\bundle5.js:133692:50) at OriginalSource.updateHash (C:\Users\admin\OneDrive\바탕 화면\learning_NestJS\frontend\node_modules\next\dist\compiled\webpack-sources2\index.js:1:19148) at NormalModule._initBuildHash (C:\Users\admin\OneDrive\바탕 화면\learning_NestJS\frontend\node_modules\next\dist\compiled\webpack\bundle5.js:65772:17) at handleParseResult (C:\Users\admin\OneDrive\바탕 화면\learning_NestJS\frontend\node_modules\next\dist\compiled\webpack\bundle5.js:65837:10) at C:\Users\admin\OneDrive\바탕 화면\learning_NestJS\frontend\node_modules\next\dist\compiled\webpack\bundle5.js:65928:4 at processResult (C:\Users\admin\OneDrive\바탕 화면\learning_NestJS\frontend\node_modules\next\dist\compiled\webpack\bundle5.js:65651:11) at C:\Users\admin\OneDrive\바탕 화면\learning_NestJS\frontend\node_modules\next\dist\compiled\webpack\bundle5.js:65711:5 Error: error:0308010C:digital envelope routines::unsupported at new Hash (node:internal/crypto/hash:71:19) at Object.createHash (node:crypto:133:10) at BulkUpdateDecorator.hashFactory (C:\Users\admin\OneDrive\바탕 화면\learning_NestJS\frontend\node_modules\next\dist\compiled\webpack\bundle5.js:133790:18) at BulkUpdateDecorator.update (C:\Users\admin\OneDrive\바탕 화면\learning_NestJS\frontend\node_modules\next\dist\compiled\webpack\bundle5.js:133692:50) at OriginalSource.updateHash (C:\Users\admin\OneDrive\바탕 화면\learning_NestJS\frontend\node_modules\next\dist\compiled\webpack-sources2\index.js:1:19148) at NormalModule._initBuildHash (C:\Users\admin\OneDrive\바탕 화면\learning_NestJS\frontend\node_modules\next\dist\compiled\webpack\bundle5.js:65772:17) at handleParseResult (C:\Users\admin\OneDrive\바탕 화면\learning_NestJS\frontend\node_modules\next\dist\compiled\webpack\bundle5.js:65837:10) at C:\Users\admin\OneDrive\바탕 화면\learning_NestJS\frontend\node_modules\next\dist\compiled\webpack\bundle5.js:65928:4 at processResult (C:\Users\admin\OneDrive\바탕 화면\learning_NestJS\frontend\node_modules\next\dist\compiled\webpack\bundle5.js:65651:11) at C:\Users\admin\OneDrive\바탕 화면\learning_NestJS\frontend\node_modules\next\dist\compiled\webpack\bundle5.js:65711:5 node:internal/crypto/hash:71 this[kHandle] = new _Hash(algorithm, xofLen); ^ Error: error:0308010C:digital envelope routines::unsupported at new Hash (node:internal/crypto/hash:71:19) at Object.createHash (node:crypto:133:10) at BulkUpdateDecorator.hashFactory (C:\Users\admin\OneDrive\바탕 화면\learning_NestJS\frontend\node_modules\next\dist\compiled\webpack\bundle5.js:133790:18) at BulkUpdateDecorator.update (C:\Users\admin\OneDrive\바탕 화면\learning_NestJS\frontend\node_modules\next\dist\compiled\webpack\bundle5.js:133692:50) at OriginalSource.updateHash (C:\Users\admin\OneDrive\바탕 화면\learning_NestJS\frontend\node_modules\next\dist\compiled\webpack-sources2\index.js:1:19148) at NormalModule._initBuildHash (C:\Users\admin\OneDrive\바탕 화면\learning_NestJS\frontend\node_modules\next\dist\compiled\webpack\bundle5.js:65772:17) at handleParseResult (C:\Users\admin\OneDrive\바탕 화면\learning_NestJS\frontend\node_modules\next\dist\compiled\webpack\bundle5.js:65837:10) at C:\Users\admin\OneDrive\바탕 화면\learning_NestJS\frontend\node_modules\next\dist\compiled\webpack\bundle5.js:65928:4 at processResult (C:\Users\admin\OneDrive\바탕 화면\learning_NestJS\frontend\node_modules\next\dist\compiled\webpack\bundle5.js:65651:11) at C:\Users\admin\OneDrive\바탕 화면\learning_NestJS\frontend\node_modules\next\dist\compiled\webpack\bundle5.js:65711:5 { opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ], library: 'digital envelope routines', reason: 'unsupported', code: 'ERR_OSSL_EVP_UNSUPPORTED' } Node.js v18.16.0위와 같은 에러가 발생하며 프론트엔드가 웹 서버가 실행되지 않고 있습니다..이러한 상황에서는 어떻게 진행하면 좋을지 조언 부탁드립니다.
- 미해결탄탄한 백엔드 NestJS, 기초부터 심화까지
res.on('finish')
안녕하세요 강의 잘 듣고 있습니다.res.on('finish', cb); 이벤트를 걸어뒀다고 가정하고 만약 어떤 request에 의한 비즈니스 로직 수행 중적당한 예외처리가 되지 못해서 서버가 죽어버리는 로직을 거쳐 res를 쏘는 부분까지 도달하지 못했다면해당 cb함수는 실행되지 않을거라고 생각했는데 맞을까요?(이렇게 되면.. 어떤 요청에 의해 프로그램이 죽었는지 알기 어려울 것 같다는 생각이 문득 들어서 질문드립니다)
- 미해결탄탄한 백엔드 NestJS, 기초부터 심화까지
고양이 정보 커뮤니티 프론트앤드와 합칠 때 오류
일단 먼저 제 상황을 말씀드릴게요 섹션 4에 강의 협업을 위한 API만들기와 CORS 문제 강의를 듣던중 프론트앤드 파일을 다운받아서 프론트앤드 파일을 열고 회원가입을 해보는 부분에서 프론트 앤드 파일이 열리지 않았습니다.강의가 작성 된지 시간이 오래 된 것인지 아니면 제가 아직 고양이 정보 커뮤니티에 대한 강의를 다 듣지 못해서 인지 확신이 되지 않아 강사님의 깃허브 05 실전 프로젝트 파일을 다운받아 npm i 로 전부 설치했고(이 때도 워낙 버전이 달라서 버전 fix 를 하는 과정이 필요했습니다.) 그리고 프론트 부분의 파일도 받아서 cd로 프론트파일쪽 폴더로 접근한다음 npm i 로 프론트에 해당하는 패키지까지 전부 설치했습니다. ( 프론트쪽 버전은 백보다 더욱 심각해서 npm install react@latest react-dom@latest 이 명령어를 쳐서 버전업을 하지 않으면 아에 오류가 뜨는 정도였습니다..) 어쨋든 이러한 과정을 마치고 localhost:3000/signup 을 실행하면 이런식으로 오류가 생기면서 되질않았습니다. 이건 일부분의 오류이고 훨씬 더 많은 오류가 생겼습니다.하나하나 다 열거하기 힘들정도라서 개인적으로 이 코드들을 수정하는것이 제 수준에선 불가능했습니다.질문에 답변하신 것을 보니 2023년에도 호환성에 문제가 없다고 되어있는데 진짜 그런지 잘모르겠습니다.
- 미해결탄탄한 백엔드 NestJS, 기초부터 심화까지
user에 delete 관련 속성이 없다는 에러가 발생합니다.
해당 에러를 해결하려고 철자라든가 패턴 잘못 작성한 게 있나 찾아봤는데 없네요..대체 어디가 문제인지 모르겠습니다
- 미해결탄탄한 백엔드 NestJS, 기초부터 심화까지
app.module.ts 하는도중에
화면처럼 AppModule에 붉은 줄이 떠서 확인을 해보니'AppModule' 클래스가 'NestModule' 인터페이스를 잘못 구현합니다. 'configure' 속성이 'AppModule' 형식에 없지만 'NestModule' 형식에서 필수입니다.ts(2420)nest-module.interface.d.ts(6, 5): 여기서는 'configure'이(가) 선언됩니다.라고 뜨는데 어떤식의 해결을 해야할 지 모르겠습니다.