-
Notifications
You must be signed in to change notification settings - Fork 440
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
3rd party XHR request still intercepted in spite of passthrough #1320
Comments
Thanks for the details & sorry you're running into this! Any chance you could post a simplified reproduction somewhere? |
Thanks, @samselikoff - here's a demo repo: https://github.com/allthesignals/ember-mirage-mapbox-example, it's simply a clone of ember-mapbox-gl with mirage installed & configured. See console for errors. Looping in @kturney who pointed out the PR here: pretenderjs/FakeXMLHttpRequest#32. It seems to be more of a Pretender issue, and might be addressed if that PR gets merged. |
@allthesignals seeing this same issue with ember-cli-mirage/ember-mapbox-gl. Were you ever able to figure out a workaround? |
@billdami we managed to monkeypatch it. See here: kturney/ember-mapbox-gl#53 (comment) |
@kturney great thanks! |
Catching up with issues here... so if the Pretender PR gets merged this should be fixed? Is that correct? |
@samselikoff I'm unsure if just that pr will fix the issue. The above linked monkeypatch also had to work around the load event getting triggered twice. |
@kturney Thanks for the info. Is your monkey patch fixing a Mirage bug, a Pretender bug or a Mapbox issue? If it's a Mirage bug, could you walk me through it? I'm trying to figure out what Mirage's responsibility is here & what the fix is/should be. Once we get that Pretender PR merged, is Mirage's role done? |
@samselikoff It definitely seems like just a Pretender bug. |
@kturney Gotcha - thanks for the reply 👍 Does pretenderjs/FakeXMLHttpRequest#32 have the correct failing test? |
That's part of it. Maybe it needs a separate pr/test for not triggering a double load event. |
May be related to #285, the 3rd party lib I'm using is MapboxGL.
Here are all my passthroughs:
Console just throws
AJAXError {status: 200}
After setting up breakpoints, the actual response 3rd party lib gets from pretender is undefined:
I'm not sure where this problem is coming from. One of the requests, https://raw.githubusercontent.com/NYCPlanning/labs-gl-style/master/data/style.json, gives strange errors when you try to visit it directly. I'm not sure if the headers are confusing pretender in someway. Any ideas?
Full stacktrace
The text was updated successfully, but these errors were encountered: