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.

TypeError: Cannot read property 'reopen' of undefined

See original GitHub issue

Hey there,

I just upgraded to the latest ember-mocha and can’t seem to shake the below error. I am running this test (setup outlined below) in the browser by visiting http://localhost:4200/tests, and when I do, I can see that this test actually passes with a green checkmark, however, it is then followed by the below error message. It also seems to be intermittent, showing up about 6/10 times when I run the below test.

Error I see displaying in the UI right below my passing test:

X  "after each" hook for "visits login page"

TypeError: Cannot read property 'reopen' of undefined
    at Class.dropObject (<anonymous>:2956:18)
    at Class.willDestroy (<anonymous>:2929:18)
    at Class.superWrapper (assets/vendor.js:42349:28)
    at invoke (assets/vendor.js:60112:24)
    at Queue.flush (assets/vendor.js:60033:25)
    at DeferredActionQueues.flush (assets/vendor.js:60185:31)
    at Backburner._end (assets/vendor.js:60615:42)
    at Backburner.end (assets/vendor.js:60418:18)
    at Backburner._run (assets/vendor.js:60658:26)
    at Backburner.run (assets/vendor.js:60453:25)

My current setup:

ember-cli: 3.7.1
ember-mocha:  ^0.14.0
ember-cli-mocha: ^0.15.0

/tests/test-helper.js

import Application from '../app';
import config from '../config/environment';
import { setApplication } from '@ember/test-helpers';

setApplication(Application.create(config.APP));

/tests/acceptance/example-test.js

import { expect } from 'chai';
import { describe, it } from 'mocha';
import { setupApplicationTest } from 'ember-mocha';
import { visit, currentURL } from '@ember/test-helpers';

describe('basic acceptance test', () => {
  setupApplicationTest();

  it('visits login page', async () => {
    await visit('/login');
    expect(currentURL()).to.equal('/login');
  });
});

/app/config/environment.js

if (environment === 'test') {
    // keep test console output quieter
    ENV.APP.LOG_ACTIVE_GENERATION = false;
    ENV.APP.LOG_VIEW_LOOKUPS = false;

    ENV.APP.rootElement = '#ember-testing';
    ENV.host = 'http://localhost';

    ENV.APP.autoboot = false;
  }

Have you seen this error pop up before? Does anything look incorrect with this current setup for running mocha tests in Ember with the new api? My tests were running as expected before the api update, and the tests are actually passing, seems like something is just getting messed up during tear town. Thanks.

Issue Analytics

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

github_iconTop GitHub Comments

2reactions
chbonsercommented, Jun 18, 2019

I’ve seen this a few times (most recently today). Restarting chrome resolved the issue.

0reactions
zubeiromcommented, Jun 27, 2019

I’ve seen this a few times (most recently today). Restarting chrome resolved the issue.

Restarting chrome did it for me, thank you very much 😃) 👍

Read more comments on GitHub >

github_iconTop Results From Across the Web

TypeError: Cannot read property 'data' of undefined
catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/ ...
Read more >
TypeError: Cannot read property 'data' of undefined
When a try to get a cumulative flow diagram, by PBI show this error "TypeError: Cannot read property 'data' of undefined". erro-azuredevops.png.
Read more >
Cannot read property 'slug' of undefined - WordPress.org
Cannot read property 'slug' of undefined in WidgetAreaRenderer in div in ... continue to encounter issues, or reopen this topic and we'd be...
Read more >
How to resolve this npm ERR! Cannot read property ...
... to reopen it. The link to the issue is : [BUG] Cannot read property 'pickAlgorithm' of null · Issue #3374 · npm/cli...
Read more >
Cannot read property 'firstChild' of undefined - Jenkins Jira
Hello,. We have a problem to access to configure page of a job because of a js exception : Uncaught TypeError: Cannot read...
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