Skip to content
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

Passthrough hangs #449

Closed
robwatkin opened this issue Dec 23, 2015 · 4 comments
Closed

Passthrough hangs #449

robwatkin opened this issue Dec 23, 2015 · 4 comments

Comments

@robwatkin
Copy link

I guess I'm missing something really basic but I can't seem to get passthrough to work.

I have created a very simple ember app with http-mock for one simple GET endpoint. I can get mirage to return data from a handler in config.js

The app can be found here https://github.com/robwatkin/mirg

mirage/config.js

this.get('/api/foofs', function() {
return {

  'foofs': [
    { id: 1, name: 'foo a'},
    { id: 2, name: 'foo b'},
    { id: 3, name: 'foo c'}
  ]
};

However, when I replace this with a passthrough

this.passthrough('/api/foofs');

ember just seems to hang, browser is empty and console says:

DEBUG: -------------------------------
DEBUG: Ember      : 1.13.11
DEBUG: Ember Data : 1.13.15
DEBUG: jQuery     : 1.11.3
DEBUG: -------------------------------
XHR finished loading: GET "http://localhost:4200/api/foofs".

Thanks

@ming-codes
Copy link

Passthrough has issue with jQuery 1.11. It's an upstream issue with pretender. Although it's being fixed now, I don't know when it'll trickle down to Mirage.

See #404

@samselikoff
Copy link
Collaborator

Yes, this sounds like the <2.x bug. Try out jQuery 2.x or point to master Pretender (we'll cut a new release soon).

@robwatkin
Copy link
Author

Thanks @ming-codes for your suggestion. Bower had defaulted to jQuery 1.x and changing to 2.1 solved the problem. I have as yet only done this on the dummy mirg project which I built to demonstrate the issue but I'm very confident it will fix the issue in our main code base.

I'm just curious @samselikoff but when I look at release 0.1.11(here https://github.com/samselikoff/ember-cli-mirage/blob/6190e9bb75e596529c48ee345124011d4a92fe56/bower.json) I notice that bower.json has jQuery 2.x. Where is the jQuery 1.x being pulled in.

Rob

@samselikoff
Copy link
Collaborator

You should be able to override the jQuery version in your own app's bower.json.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants