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

mirage enabled even when using --proxy flag #2558

Closed
Techn1x opened this issue Oct 12, 2023 · 5 comments · Fixed by #2559
Closed

mirage enabled even when using --proxy flag #2558

Techn1x opened this issue Oct 12, 2023 · 5 comments · Fixed by #2559
Labels

Comments

@Techn1x
Copy link

Techn1x commented Oct 12, 2023

It looks like this PR #2495 released 2 weeks ago under 3.0.0-alpha.4 has removed the config/environment.js file

That config/environment.js file had a usingProxy() function that would set ENV['ember-cli-mirage'].usingProxy to true if proxy flag was set
https://github.com/miragejs/ember-cli-mirage/pull/2495/files#diff-77d6e2aab53cbf594475ecab6eac3882cd95a1c3d95085833caa58c39cb0a910L4-L11

When usingProxy is true, that would disable mirage server in the initializer

let usingInDev = env === 'development' && !addonConfig.usingProxy;

Right now nothing sets that usingProxy property in the config, so mirage ends up being enabled even when proxies are set

This seems like an unintentional change (wasn't mentioned in 3.0.0 Breaking Changes)

@Techn1x
Copy link
Author

Techn1x commented Oct 12, 2023

cc @deepfryed

@SergeAstapov
Copy link
Collaborator

@Techn1x sorry for churn, fix published in v3.0.1

@Techn1x
Copy link
Author

Techn1x commented Oct 13, 2023

Thanks so much! You do great work! I am just glad to see things moving in mirage land :)

@ijlee2
Copy link
Contributor

ijlee2 commented Oct 18, 2023

@Techn1x @SergeAstapov I appreciate the report and the quick response, as my team encountered a related issue on 3.0.0. Updating ember-cli-mirage to 3.0.1 fixed our problem, and the update from 2.4.0 to 3.0.0 went otherwise smoothly. ✨

Even after updating to 3.0.1, one of our developers found that the issue exists on their Windows machine. By temporarily updating the Mirage config to passthrough all requests, the requests to the desired server worked:

function routes() {
  this.passthrough();
  // removed all other overrides
}

We're not sure yet if the Windows issue is an existing one, either in ember-cli-mirage or miragejs. If we can come up with a minimal reproducible app (I imagine this will take time, as we would need to create an Ember app as well as a Rails/Node server), we'll let you know.

(Could be hard-coded / in paths like https://github.com/miragejs/ember-cli-mirage/pull/2559/files#diff-77d6e2aab53cbf594475ecab6eac3882cd95a1c3d95085833caa58c39cb0a910R14.)

This was referenced Oct 18, 2023
@SergeAstapov
Copy link
Collaborator

@ijlee2 thank you for the pull request! This is released as v3.0.2

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

Successfully merging a pull request may close this issue.

3 participants