Quantcast
Viewing all articles
Browse latest Browse all 4836

What did I break? I seem to have 2 different versions of the same dependency

TL;DR I seem to have two miragejs modules and this causes some problems:

  1. webpack://__ember_auto_import__/./node_modules/miragejs/dist/mirage-esm.js?
  2. 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

Read full topic


Viewing all articles
Browse latest Browse all 4836

Trending Articles