openapistack / openapi-client-axios

JavaScript client library for consuming OpenAPI-enabled APIs with axios
https://openapistack.co
MIT License
535 stars 67 forks source link

Build error with 7.2.0 #157

Closed mat813 closed 1 year ago

mat813 commented 1 year ago

I don't exactly understand what happened, but with 7.2.0, I get this build error:

$ tsc
node_modules/openapi-client-axios/client.d.ts(135,13): error TS2411: Property 'link' of type 'AxiosHeaders | undefined' is not assignable to 'string' index type 'string | number | boolean | string[] | AxiosHeaders'.
node_modules/openapi-client-axios/client.d.ts(136,13): error TS2411: Property 'head' of type 'AxiosHeaders | undefined' is not assignable to 'string' index type 'string | number | boolean | string[] | AxiosHeaders'.
node_modules/openapi-client-axios/client.d.ts(137,13): error TS2411: Property 'options' of type 'AxiosHeaders | undefined' is not assignable to 'string' index type 'string | number | boolean | string[] | AxiosHeaders'.
node_modules/openapi-client-axios/client.d.ts(138,13): error TS2411: Property 'get' of type 'AxiosHeaders | undefined' is not assignable to 'string' index type 'string | number | boolean | string[] | AxiosHeaders'.
node_modules/openapi-client-axios/client.d.ts(139,13): error TS2411: Property 'delete' of type 'AxiosHeaders | undefined' is not assignable to 'string' index type 'string | number | boolean | string[] | AxiosHeaders'.
node_modules/openapi-client-axios/client.d.ts(140,13): error TS2411: Property 'post' of type 'AxiosHeaders | undefined' is not assignable to 'string' index type 'string | number | boolean | string[] | AxiosHeaders'.
node_modules/openapi-client-axios/client.d.ts(141,13): error TS2411: Property 'put' of type 'AxiosHeaders | undefined' is not assignable to 'string' index type 'string | number | boolean | string[] | AxiosHeaders'.
node_modules/openapi-client-axios/client.d.ts(142,13): error TS2411: Property 'patch' of type 'AxiosHeaders | undefined' is not assignable to 'string' index type 'string | number | boolean | string[] | AxiosHeaders'.
node_modules/openapi-client-axios/client.d.ts(143,13): error TS2411: Property 'purge' of type 'AxiosHeaders | undefined' is not assignable to 'string' index type 'string | number | boolean | string[] | AxiosHeaders'.
node_modules/openapi-client-axios/client.d.ts(144,13): error TS2411: Property 'unlink' of type 'AxiosHeaders | undefined' is not assignable to 'string' index type 'string | number | boolean | string[] | AxiosHeaders'.
node_modules/openapi-client-axios/client.d.ts(145,13): error TS2411: Property 'common' of type 'AxiosHeaders | undefined' is not assignable to 'string' index type 'string | number | boolean | string[] | AxiosHeaders'.
error Command failed with exit code 2.

I don't think I am the problem, but I don't really get it.

dumdiedum commented 1 year ago

I'm also getting same error when building. I could localize problem within ./node_modules/openapi-client-axios/client.d.ts:

grafik

I can "fix" it locally when adding "| undefined" at line 134: grafik

Maybe this will help fixing this, @anttiviljami?

anttiviljami commented 1 year ago

Hi @dumdiedum @mat813, thanks for reporting this. Couldn't find a way to reproduce this but hopefully adding the correct return type fixes the issue for you 🙏

Published as part of openapi-client-axios@7.3.1

mat813 commented 1 year ago

It did, thank you.