-
Notifications
You must be signed in to change notification settings - Fork 765
Closed
Description
I'm getting
browser.js:1 Uncaught ReferenceError: window is not definedThis 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)
- OS: macOS
- Environment: Chrome Version 89.0.4389.90
- Method of installation: npm
- Swagger-Client version: 3.12.0
- Swagger/OpenAPI version: OpenAPI 3.0.1
Content & configuration
Swagger/OpenAPI definition:
Swagger-Client usage:
import SwaggerClient from 'swagger-client';
SwaggerClient.resolve({
url: '/api/am/publisher/v2/swagger.yaml',
requestInterceptor: (request) => {
request.headers.Accept = 'text/yaml';
},
}).then((spec) => {
self.postMessage(spec);
});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?
