TL;DR
I seem to have two miragejs
modules and this causes some problems:
webpack://__ember_auto_import__/./node_modules/miragejs/dist/mirage-esm.js?
webpack://__ember_auto_import__/./node_modules/<my-dependency>/node_modules/miragejs/dist/mirage-esm.js?
About the dependencies: I have an Ember add-on whose dummy app uses ember-cli-mirage
which depends upon miragejs
. I also include my package as a dependency that depends upon miragejs
itself.
This discovery came about because I noticed a strange issue and started debugging…
While stepping through some Mirage code, I found the issue. Mirage does a check to see if a model’s property is an instance of Mirage’s Association
class and this check was failing, to my surprise. Here’s where things got weird (to me)…
The Mirage source was in webpack://__ember_auto_import__/./node_modules/miragejs/dist/mirage-esm.js?
whereas in my code I have a Mirage model with a property that’s an instance of Association
from webpack://__ember_auto_import__/./node_modules/<my-dependency>/node_modules/miragejs/dist/mirage-esm.js?
thus the check in the Mirage code fails.
I’m wondering why/how I end up with seemingly 2 different miragejs
modules.
3 posts - 2 participants