nestjs-soap
nestjs-soap copied to clipboard
"path" argument
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,
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.
@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
+1
@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: