Closed FranDepascuali closed 1 year ago
Hi @FranDepascuali, you’ll still need to add the required polyfills in your build config. Take a look at the README for examples:
https://github.com/anttiviljami/openapi-client-axios#browser-usage
It's really difficult to add a polyfill in react-native like that as it doesn't use a webpack setup.
Been reading into https://github.com/philikon/ReactNativify and https://github.com/tradle/rn-nodeify but it sounds pretty complicated.
I will tell you if I had any luck.
Thanks!
This seems like a straightforward solution for rn. https://stackoverflow.com/a/41511414
There might be other polyfills you need too like util
IIRC
Tried that lib
Update: I tried every possible way I could, using different polyfill implementation.
I couldn't make it work, there's always strange runtime errors when polyfilling.
I tried other alternatives to generate a typescript axios client (gonna list them later). They work BUT this lib has two important aspects:
This lib seems awesome. I'll try other versions in the future to see if the errors change or it's available for us with react native.
Thanks you very much @anttiviljami !!
Depa
Hi @FranDepascuali. The issues come from the json-schema-ref-parser
dependency used by this library.
Unfortunately this lib is no longer really maintained and causes multiple issues for us, including a bloated bundle size and difficulty in non Node.js environments.
I’ve asked my team at @epilot-dev to take a look at replacing with a simpler, more compatible implementation. A lot of the features from json-schema-ref-parser
are not really necessary for openapi-client-axios
Thank you @anttiviljami for fixing the previous issue #140 I reported!
When I try, I still have errors regarding dependencies not supported in our node.js runtime due to
json-schema-ref-parser
.Thank you! Depa