-
Notifications
You must be signed in to change notification settings - Fork 761
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to use SwaggerClient in web worker #2008
Comments
swagger-js should work properly in Web Worker environment. The problem is (as you already mentioned correctly in this issue) |
Added a comment in |
Current workaround could be to use resolve alias in your webpack config to get around this problem. Webpack config ...
resolve: {
alias: {
'isomorphic-form-data': path.resolve(__dirname, 'src/isomorphic-form-data.js/')
}
}
... isomorphic-form-data.js module.exports = globalThis.FormData This will bypass the Please let me know if this temporary workaround worked for you. |
Thanks @char0n , I will check and let you know |
I've issued a PR against https://github.com/form-data/isomorphic-form-data to fix this issue. Let's see if authors merge it and release a new major release. |
It's high time to fix this; isomorphic-form-data library looks completely dead and the fix is not going to come from upstream. Here is a plan to resolving this issue in SwaggerJS repo:
More context here: #1547 After we have this resolved, swagger-client will be natively support in WebWorker env without workarounds provided in comments of this issue. PR is ready here: #2154 |
This remove use of isomorphic-form-data. Refs #2008
This remove use of isomorphic-form-data. Refs #2008
- remove use of isomorphic-form-data - set minimum Node.js version to 12.4.x - introduce browser package.json field override Refs #2008
I'm getting
This exception is coming from
swagger-client -> HTTP -> form-data-monkey-patch -> isomorphic-form-data)
Exception when trying to use SwaggerClient in a web worker. I did a little bit of a search and found that there is an issue created in
isomorphic-form-data
repo asking for a solution.I tried setting outputglobalobject in webpack output also, But that didn't work.
Q&A (please complete the following information)
Content & configuration
Swagger/OpenAPI definition:
Link to definition
Swagger-Client usage:
Screenshots
How can we help?
Can you please help me in using the SwaggerClient in the work environment? Is SwaggerClient support it or am I doing anything wrong here?
The text was updated successfully, but these errors were encountered: