Closed voydz closed 4 months ago
Hi @voydz,
According to this article, React Native supports exports
fields since v0.72. Some of swagger-client dependencies also use imports package.json field as well.
If the swagger-client still doesn't work for you, you can try using UMD build:
import SwaggerClient from 'swagger-client/dist/swagger-client.browser.js'
Hope it helped a bit.
Q&A (please complete the following information)
Content & configuration
Swagger/OpenAPI definition:
Swagger-Client usage:
Describe the bug you're encountering
upon using newer versions of swagger-client >= 19 the following error will prevent the usage in react-native
To reproduce...
Steps to reproduce the behavior: (setup of react-native is required)
npx react-native@latest init SwaggerTest --pm npm --install-pods false
npm i swagger-client
import swagger client in App.tsx
import SwaggerClient from 'swagger-client';
add the following code block to the top of the App component
start react-native
npm start
and launch any app i.e. by pressing 'a' in the react-native cliExpected behavior
app should initialize swagger-client without error
Additional context or thoughts
issue may be related to #3136