openapistack / openapi-client-axios

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

Fresh installation of any packages dependent `openapi-client-axios` are broken #55

Closed npdev453 closed 3 years ago

npdev453 commented 3 years ago

Hi @anttiviljami,

yesterday one of my experemental package was broken when was installed freshly (without package-lock.json and node_modules) with next error:

     TypeError: Cannot read property 'dereference' of undefined

      at crawl (node_modules/@apidevtools/json-schema-ref-parser/lib/dereference.js:44:15)
      at Object.dereference [as default] (node_modules/@apidevtools/json-schema-ref-parser/lib/dereference.js:19:22)
      at OpenAPIClientAxios.initSync (node_modules/openapi-client-axios/client.js:206:34)
      at Object.B.default (<index.js>:42:25)
      at new e.B (<index.js>:384:11)

After some drilling of some sources I detect that reasons of the problem is in:

So, that error can be catched by anyone who will install openapi-client-axios in new projects or while force deps upgrade, by that reason asking to fix it asap.

PR with fix: https://github.com/anttiviljami/openapi-client-axios/pull/54

anttiviljami commented 3 years ago

Hi! I've merged #54 and released openapi-client-axios@3.7.9