question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

This addon will break when used together with ember-cli-mirage

See original GitHub issue

It took us a while to figure out what the problem is but in our application we use both ember-data-change-tracker and ember-cli-mirage. After upgrade from 0.7.7 to 0.8.0 we noticed that if Mirage is enabled, methods like startTrack() are missing on all models.

I found a fix, it’s about adding before: 'ember-cli-mirage' to https://github.com/danielspaniel/ember-data-change-tracker/blob/master/app/initializers/ember-data-change-tracker.js

But the problem is it will fail in case ember-cli-mirage is not present in the project. I was also trying to debug ember-cli-mirage but I wasn’t able to find any place which I could fix to make this addon work.

Maybe authors of this addon would have some idea how to fix it. I’m not that familiar with the internals of Ember.js. The help would be very appreciated. Thank you

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
Leooocommented, Oct 17, 2019

moving the initializer before ember-cli-mirage fixed it for me:

import {initializer as initialize} from 'ember-data-change-tracker';

export default {
  name: 'ember-data-change-tracker',
  after: 'ember-data',
  before: 'ember-cli-mirage',
  initialize
};
0reactions
synaptikocommented, Oct 18, 2019

@Leooo yes, that’s the fix described in my first comment and that’s exactly what we ended up doing in our fork: https://github.com/bayzat/ember-data-change-tracker/commit/ec2d6c16ba0fa4fb5e8274ed075aa23807fce4ce

But it has this downside that it will break in case ember-cli-mirage is not installed (for us it’s not a problem because we used for all our modules currently).

Read more comments on GitHub >

github_iconTop Results From Across the Web

embroider/macros causing builds to fail > v2.2 #2343 - GitHub
Our investigation lead us to the bump from mirage version 2.2 to 2.4, by locking it to 2.2 builds weren't crashing anymore (2.3...
Read more >
Upgrading - Ember CLI Mirage
The ember g ember-cli-mirage command ensures all of Mirage's Bower dependencies are added to your project. It runs during ember install , and...
Read more >
Ember CLI Mirage Tutorial and Examples - Program With Erik
In this tutorial we'll create a simple Ember app and mock the server with Ember CLI Mirage. The application will have a posts...
Read more >
ember-cli-mirage-nested - npm
This addon does two different things at the moment and will be soon split into ember-cli-mirage-scenario-chaining and ember-cli-mirage-gui ...
Read more >
Six useful Ember addons for testing - WyeWorks
The idea is to give you a hint of what problems they solve and how they work. This is the list of addons...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found