We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
none
No response
Maybe we need writing a depth limiter manually (see microsoft/TypeScript#45711).
@nestjs/common
@nestjs/core
@nestjs/microservices
@nestjs/platform-express
@nestjs/platform-fastify
@nestjs/platform-socket.io
@nestjs/platform-ws
@nestjs/testing
@nestjs/websockets
@nestjs/config
"@nestjs/common": "^10.3.2", "@nestjs/config": "^3.2.0", "@nestjs/core": "^10.3.2",
18
The text was updated successfully, but these errors were encountered:
Which version of typescript are you using?
Sorry, something went wrong.
您使用的是哪个版本的打字稿?
"typescript": "^5.3.3"
Sorry, this is my problem, I used DataSourceOptions as ConfigType incorrectly, sorry for wasting your precious time.
DataSourceOptions
ConfigType
import { registerAs } from '@nestjs/config' import { DataSource, DataSourceOptions } from 'typeorm' + import { MysqlConnectionCredentialsOptions } from 'typeorm/driver/mysql/MysqlConnectionCredentialsOptions' import { env, envBoolean, envNumber } from '~/global/env' // eslint-disable-next-line import/order import dotenv from 'dotenv' dotenv.config({ path: `.env.${process.env.NODE_ENV}` }) const dataSourceOptions: DataSourceOptions = { type: 'mysql', host: env('DB_HOST', '127.0.0.1'), port: envNumber('DB_PORT', 3306), username: env('DB_USERNAME'), password: env('DB_PASSWORD'), database: env('DB_DATABASE'), synchronize: envBoolean('DB_SYNCHRONIZE', false), entities: ['dist/modules/**/*.entity{.ts,.js}'], migrations: ['dist/migrations/*{.ts,.js}'], subscribers: ['dist/modules/**/*.subscriber{.ts,.js}'], } export const dbRegToken = 'database' export const DatabaseConfig = registerAs( dbRegToken, (): DataSourceOptions => dataSourceOptions, ) - export type IDatabaseConfig = ConfigType<typeof DatabaseConfig> + export type IDatabaseConfig = Pick<MysqlConnectionCredentialsOptions, 'host' | 'port' | 'username' | 'password' | 'database'> const dataSource = new DataSource(dataSourceOptions) export default dataSource
No branches or pull requests
Is there an existing issue for this?
Current behavior
Minimum reproduction code
none
Steps to reproduce
No response
Expected behavior
Maybe we need writing a depth limiter manually (see microsoft/TypeScript#45711).
Package
@nestjs/common
@nestjs/core
@nestjs/microservices
@nestjs/platform-express
@nestjs/platform-fastify
@nestjs/platform-socket.io
@nestjs/platform-ws
@nestjs/testing
@nestjs/websockets
Other package
@nestjs/config
NestJS version
No response
Packages versions
Node.js version
18
In which operating systems have you tested?
Other
No response
The text was updated successfully, but these errors were encountered: