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
fix: prevent "MockedRequest" constructor loop #1328
Conversation
95th
commented
Jul 14, 2022
- Fixes msw fails to run on 0.44.0 #1326
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 20baac3:
|
if (input instanceof IsomorphicRequest) { | ||
super(input) | ||
} else { | ||
super(input, init) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This call goes to IR constructor in tests but MR constructor in repro.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great. Thank you once more for making this library better, @95th!
The only thing remaining is to depict this issue in a test case.
I can't reproduce this locally at all. I agree that this is a transpilation issue, as the constructor(input) {
var _supercall = function () {
return _supercall(...arguments);
};
let init = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
var __super = function () {
_supercall(...arguments);
};
if (input instanceof import_interceptors.IsomorphicRequest) {
__super(input);
} else {
__super(input, init);
}
if (init.id) {
this.id = init.id;
}
this.cache = init.cache || "default";
this.destination = init.destination || "";
this.integrity = init.integrity || "";
this.keepalive = init.keepalive || false;
this.mode = init.mode || "cors";
this.priority = init.priority || "auto";
this.redirect = init.redirect || "follow";
this.referrer = init.referrer || "";
this.referrerPolicy = init.referrerPolicy || "no-referrer";
this.cookies = init.cookies || this.getCookies();
} How is this ever a valid transpilation result? var _supercall = function () {
return _supercall(...arguments);
}; |
Released: v0.44.1 🎉This has been released in v0.44.1! Make sure to always update to the latest version ( Predictable release automation by @ossjs/release. |