nestjs-soap icon indicating copy to clipboard operation
nestjs-soap copied to clipboard

"path" argument

Open alexeyinn opened this issue 2 years ago • 4 comments

Getting error - [Nest] 4256 - ERROR [SoapModule] The "path" argument must be of type string or an instance of Buffer or URL. Received undefined

  • An error occurred while creating the soap client. Check the SOAP service URL and status.

My code:

import { Module } from "@nestjs/common";
import { SoapModule, SoapModuleOptions } from "nestjs-soap";
import { ConfigService, ConfigModule } from "@nestjs/config";

@Module({
  imports: [
    SoapModule.forRootAsync({
      clientName: "MY_SOAP_CLIENT",
      imports: [ConfigModule],
      inject: [ConfigService],
      useFactory: async (
        configService: ConfigService
      ): Promise<SoapModuleOptions> => ({
        clientName: "MY_SOAP_CLIENT",
        uri: configService.get<string>(
          "MY_API_URL_IS_HERE"
        ),
        auth: {
          username: configService.get<string>("MY_USERNAME_HERE"),
          password: configService.get<string>("MY_PASSWORD_HERE"),
        },
      }),
    }),
  ],
})
export class SoapM {}

alexeyinn avatar Apr 15 '22 13:04 alexeyinn

@alexeyinn,

Sorry for the delay. You maybe solved it already.

Are you sure this is getting the url: configService.get("MY_API_URL_IS_HERE") ? This error seems related to it.

lehh avatar May 24 '22 16:05 lehh

@alexeyinn,

Sorry for the delay. You maybe solved it already.

Are you sure this is getting the url: configService.get("MY_API_URL_IS_HERE") ? This error seems related to it.

Yes

alexeyinn avatar May 24 '22 16:05 alexeyinn

+1

aonoriaga avatar Oct 27 '22 03:10 aonoriaga

@alexeyinn, @aonoriaga

Which exact version of nestjs and nestjs-soap are you using? Could you share your package.json or a working repository with the error?

This usually happens when the uri is undefined, probably because of a wrong or unset environment variable.

The same happens if I do this: image

lehh avatar Oct 29 '22 18:10 lehh