Skip to content

ERROR [ExceptionHandler] The "path" argument must be one of type string, Buffer, or URL. Received type undefined #3

@lexprimost

Description

@lexprimost

Hi i'm getting this error in the main.ts file on this line

const configService = new ConfigService('.env');

The error:

[Nest] 86043 - 2022-02-02 17:29:13 ERROR [ExceptionHandler] The "path" argument must be one of type string, Buffer, or URL. Received type undefined
TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be one of type string, Buffer, or URL. Received type undefined
at Object.openSync (fs.js:432:10)
at Object.readFileSync (fs.js:342:35)
at new ConfigService (/Users/primaellebrun/apis/gazon-api/src/config/config.service.ts:8:38)
at Injector.instantiateClass (/Users/primaellebrun/apis/gazon-api/node_modules/@nestjs/core/injector/injector.js:291:19)
at callback (/Users/primaellebrun/apis/gazon-api/node_modules/@nestjs/core/injector/injector.js:43:41)
at Injector.resolveConstructorParams (/Users/primaellebrun/apis/gazon-api/node_modules/@nestjs/core/injector/injector.js:119:24)

Can you help?
Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions