我正在NestJS应用程序中创建一个PDF文档。我的问题是我不能导入字体。它们被正确地复制到/dist-folder中,但我得到了以下错误:
/dist/assets/Mulish-Italic.ttf:1
SyntaxError: Invalid or unexpected token
at compileFunction (<anonymous>)
at Object.compileFunction (node:vm:352:18)
at wrapSafe (node:internal/modules/cjs/loader:1031:15)
a
我正在使用@nestjs/passport。在运行npm run start:dev之后,我得到了一个错误,但是编辑器没有显示错误 node_modules/@nestjs/passport/dist/passport/passport.serializer.d.ts:1:27 - error TS2307: Cannot find module 'passport' or its corresponding type declarations.
1 import * as passport from 'passport'; 输入代码: import { P
我得到了这个关于AxiosRequestConfig的错误,它非常具体,但在谷歌中仍然找不到。有什么建议吗?谢谢 Argument of type 'AxiosRequestConfig' is not assignable to parameter of type 'AxiosRequestConfig<any>'.
Types of property 'adapter' are incompatible.
Type 'import("/Users/apple/Dev/back-end-api/node
我有一个使用mongodb和redis的应用程序。
我想在上执行测试,但是每次我运行测试时都会得到以下错误。
命令:docker-compose -p tests run --rm main npm run test
错误:
FAIL test/content/document/content.document.test.ts
● Test suite failed to run
Cannot find module 'request'
at node_modules/request-promise-native/lib/rp.js:8:12
我有一个nestjs模块,在该模块中,我希望使用APP_GUARD提供程序定义多个警卫。文档中的示例仅说明如何定义单个保护。如何定义多个警卫?
import { APP_GUARD } from '@nestjs/core';
import { Module } from '@nestjs/common';
@Module({
providers: [
{
provide: APP_GUARD,
useClass: MyFirstGuard, // how can I add a second guard here?
我已经为全球使用设置了一个防护装置。每当我试图将我的用户服务注入到保护程序中时,在编译- Nest can't resolve dependencies of the VerifyUserGuard (?). Please make sure that the argument dependency at index [0] is available in the UserModule context.时就会得到这个错误。
我的用户服务是用户模块的一部分,在用户服务中我使用了@InjectRepository(User) private readonly _usersRepositor
我试图在nestjs中将所有日志(引导、应用程序错误消息、db连接错误消息)捕获到一个日志文件中。
到目前为止,我正在使用自定义记录器。下面是我的自定义记录器代码
logger.ts
import * as winston from 'winston';
import * as chalk from 'chalk';
import PrettyError from 'pretty-error';
import { LoggerOptions } from 'winston';
export class LoggerService
对不起,我的英语很差,我来自乌克兰:)你能告诉我如何创建我自己的服务,从npm包扩展Jwt服务提供的jwt模块吗?我希望为捕获错误创建自己的JwtService,并隔离重复逻辑以创建和验证令牌。求你了,帮帮我,我怎么做?附代码样本。
import { BadRequestException, Injectable } from '@nestjs/common';
import { JwtService as NestJwtService, JwtVerifyOptions } from '@nestjs/jwt';
@Injectable()
export c
在我的nestjs项目中,我在尝试使用TypeError: callback is not a function ()时使用猫鼬并获取model.save。
"@nestjs/common": "^8.0.0",
"@nestjs/config": "^1.2.0",
"@nestjs/core": "^8.0.0",
"@nestjs/mongoose": "^9.0.2",
"mongoose": "^6.2.6",
在用于存储数据
我正在尝试使用type-graphql创建一个参数类型,以便通过GraphQL查询接受参数。我所说的sort是上的选项的一个属性。
@ArgsType()
export class FindAllArgs implements FindOneOptions {
@Field(type => Int, { defaultValue: 0, description: 'Sets the limit of documents returned in the query.' })
@Min(0)
limit?: number;
// This i