Mirrage throws an undefined error even with passthrough enabled.
See original GitHub issueThe code:
import { Server } from "miragejs"
new Server({
routes() {
this.passthrough()
}
})
The fetching code:
return fetch(endpoint + directory + `/${providerName}.json`)
Error message: Mirage: Your app tried to GET ‘http://localhost:8503/providers/…’, but there was no route defined to handle this request. Define a route for this endpoint in your routes() config. Did you forget to define a namespace?
I wanted to mock /api
namespace so I tried adding it, no luck, it still throws even tho it has passthrough enabled.
Also I have a question, would mirage have any problems with running multiple instances simultaneously? I’m developing a microfrontend project, all microfronteds run on the same page (not iframe based).
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Better default passthrough behavior · Issue #244 - GitHub
and then Mirage would be able to throw an error about undefined route handlers for requests made to /api/* . Anyways, we don't...
Read more >Configuration - Ember CLI Mirage
By default, if your Ember app makes a request that is not defined in your server config, Mirage will throw an error. You...
Read more >vue.js - Mirage undefined error (no route defined) when ...
My problem was that my API is running on a different port than my ... By default this.passthrough() only works for requests on...
Read more >Uncaught TypeError: Cannot read property of undefined
If you get undefined error, you need to make sure that which ever variables throws undefined error, is assigned a value to it....
Read more >undefined reference to printf assembly - Чернігівеліткартопля
If the integer part of the floating point number cannot fit in the destination type, For a function that returns a possible error...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@samselikoff nice to hear that.
Yeah, I was requesting different address. Sadly can’t test this as I’m no longer using mirage in that project. I found that it is easier to setup simple json server for developing a microfrontend application.
But I really like mirage in my other projects! Thanks for awesome work)
No problem + appreciate you posting. Passthrough + integration is the #1 issue people run into and I think it will make sense to add proper server option (either via node or service worker) to Mirage soon. We are hoping to do it soon after closing existing bugs and shipping a v1.
Sorry again you ran into this!