dderevjanik / wsdl-tsclient

:page_facing_up: Generate typescript client from WSDL
https://npm.im/wsdl-tsclient
MIT License
97 stars 71 forks source link

error TS2440: Import declaration conflicts with local declaration of 'SoapClient'. #57

Open kolarski opened 1 year ago

kolarski commented 1 year ago

Building the client, it produces an error:

$ tsc
src/client/soap/client.ts(1,10): error TS2440: Import declaration conflicts with local declaration of 'SoapClient'.

In client.ts there is a line

export interface SoapClient extends SoapClient {

obviously a class cannot extend itself,

an easy fix will be to change the import statement to:

import { Client as SoapClientBase, createClientAsync as soapCreateClientAsync } from "soap";

and then use it like so:

export interface SoapClient extends SoapClientBase {

Is there something I might be missing here, or is it a bug ?

kolarski commented 1 year ago

Ah, I figured it out! I was using a file named: soap.wsdl file, which generated SoapClient which happens to match the default SoapClient.

Renaming the file soap.wsdl to something else resolved the issue, but it should be nice to have a check or warning for this in the generator.

I think this issue can be closed now.

peterarusanoff commented 10 months ago

I had a similar issue with a number in my wsdl file name and that caused a bunch of issues