Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Embroider safe tests hang for all addons #827

Closed
RobbieTheWagner opened this issue May 28, 2021 · 24 comments
Closed

Embroider safe tests hang for all addons #827

RobbieTheWagner opened this issue May 28, 2021 · 24 comments

Comments

@RobbieTheWagner
Copy link

I am not sure if this is due to something like ember-cli-addon-docs or what is causing all my addons to hang when I try to add the embroider ember-try scenarios, but I always get Global error: Uncaught ReferenceError: Ember is not defined.

Here are a couple builds:

RobbieTheWagner/ember-math-helpers#509
shepherd-pro/ember-shepherd#779

@ef4 any ideas here?

@nlfurniss
Copy link

Maybe the same issue?

@RobbieTheWagner
Copy link
Author

Ah, yes, perhaps. Will wait for a fix to land and see.

@stefanpenner
Copy link
Collaborator

Global error: Uncaught ReferenceError: Ember is not defined should be resolved with emberjs/ember.js#19586.

Your tests don't seem to be failing due to ^ any longer, rather some other issue that at first glance seems like it may not be an issue in embroider rather embroider appears to be providing actionable resolution steps:

Build Error (PackagerRunner) in ../../node_modules/ember-modal-dialog/templates/components/modal-dialog.hbs

Module Error (from ../../../../../home/runner/work/ember-shepherd/ember-shepherd/node_modules/thread-loader/dist/cjs.js):
Unsafe dynamic component: this.modalDialogComponentName in $TMPDIR/embroider/1d2fa5/node_modules/ember-modal-dialog/templates/components/modal-dialog.hbs/modal-dialog.hbs

I am going to close this issue, but feel free to reopen if I have closed in error.

@RobbieTheWagner
Copy link
Author

@stefanpenner my tests still fail with Global error: Uncaught ReferenceError: Ember is not defined they just hang for hours before you see that message.

@RobbieTheWagner
Copy link
Author

Here is the error still occurring https://github.com/shipshapecode/ember-shepherd/pull/779/checks?check_run_id=2759690063#step:5:295

Should it be fixed in Ember 3.27.3 or just in canary or how do I test it out?

@RobbieTheWagner
Copy link
Author

@rwjblue
Copy link
Collaborator

rwjblue commented Jun 7, 2021

@rwwagner90 should have been fixed with ember-source@3.27.3, and tarballs from release + beta + canary channels

@rwjblue
Copy link
Collaborator

rwjblue commented Jun 7, 2021

@rwwagner90 - The last link you shared was not anything to do with Ember is not defined, the log you linked to shows:

not ok 1 Chrome 91.0 - [undefined ms] - Global error: Uncaught Error: an unsupported module was defined, expected `define(id, deps, module)` instead got: `1` arguments to define` at http://localhost:7357/assets/vendor.js, line 67

Which is due to a double transpilation of qunit. You need to tell the system to skip babeling qunit.

See https://github.com/shipshapecode/ember-meta/pull/28/files#r646644689 for details.

@RobbieTheWagner
Copy link
Author

@rwjblue Thanks for the help with ember-meta!

I am still experiencing Ember is not defined on ember-shepherd. The embroider safe tests run for the max time of 360 minutes, then time out, but if you want for the timeout or cancel, you can see the first few tests are throwing Ember is not defined.

@rwjblue
Copy link
Collaborator

rwjblue commented Jun 7, 2021

I am still experiencing Ember is not defined on ember-shepherd.

Ya, I am still debugging that one. It does look like it is using ember-source@3.27.3 (on initial review), so trying to see if it is actually using an old Ember or if somethign else is wrong...

@rwjblue rwjblue reopened this Jun 7, 2021
@mydea
Copy link
Contributor

mydea commented Jun 8, 2021

FYI, I still get

Could not find module `qunit` imported from `(require)`

With:

  • ember-source 3.27.3
  • @embroider/test-support 0.41.0

And this code:

  const { maybeEmbroider } = require('@embroider/test-setup');
  return maybeEmbroider(app, {
    skipBabel: [{ package: 'qunit' }],
  });

Here: https://github.com/fabscale/ember-layout-components/pull/241/checks?check_run_id=2774322248

@rwjblue
Copy link
Collaborator

rwjblue commented Jun 8, 2021

@mydea - Have you debugged? What is importing qunit when the error is thrown?

@mydea
Copy link
Contributor

mydea commented Jun 9, 2021

I get this error when installing latest embroider/core & compat & webpack & webpack, run ember s and go to /tests:

Uncaught Error: Could not find module `qunit` imported from `(require)`
    at missingModule (loader.js:247)
    at findModule (loader.js:258)
    at requireModule (loader.js:24)
    at eval (qunit.js:1)
    at Object.../../../externals/qunit.js (chunk.afbb080cb1cb1758f869.js:138)
    at __webpack_require__ (chunk.afbb080cb1cb1758f869.js:162)
    at eval (test-helper.js:4)
    at Object../tests/test-helper.js (chunk.afbb080cb1cb1758f869.js:128)
    at __webpack_require__ (chunk.afbb080cb1cb1758f869.js:162)
    at eval (test.js:215)
tests:57 Uncaught Error: The tests file was not loaded. Make sure your tests index.html includes "assets/tests.js".
    at HTMLDocument.<anonymous> (tests:57)

Not sure if that helps?

@rwjblue
Copy link
Collaborator

rwjblue commented Jun 9, 2021

@mydea - Ya, I'm mostly asking what code is actually trying to get qunit module (e.g. look in the debugger, where the exception is thrown and figure out what package/addon/module/etc is doing it).

@mydea
Copy link
Contributor

mydea commented Jun 9, 2021

As far as I can tell it is this line in the (default?) tests/test-helpers.js file:

import * as QUnit from 'qunit';

@rwjblue
Copy link
Collaborator

rwjblue commented Jun 9, 2021

Hmm, @mydea looks like that addon didn't update to latest ember-qunit properly (docs here), it doesn't have ember-auto-import as a devDep (which is the only way qunit is ever going to end up in the build). Can you add ember-auto-import and see if that fixes the issue for you?

@mydea
Copy link
Contributor

mydea commented Jun 10, 2021

Huh, that worked! I removed ember-auto-import from the dev dependencies as I was not aware it was being used by something in the default blueprint. And since the regular tests worked, I thought that was all good. Weird that this would only fail in embroider then, but in in a regular build 🤔 but thanks a lot for the help!

@lifeart
Copy link
Collaborator

lifeart commented Jun 10, 2021

@lifeart
Copy link
Collaborator

lifeart commented Jun 10, 2021

in short, updating addon blueprint with ember-auto-import v2 may cause a lot of issues for addon authors.

@rwjblue
Copy link
Collaborator

rwjblue commented Jun 11, 2021

OK, sorry folks. I'm going to close this issue for now. I think there are still valid / active problems that folks are working through, but this issue thread has become a dumping ground of a bunch of different and unrelated (other than that they cause issues) things.

For anyone that is still having issues, please open a new issue dedicated to the specific problem that you are facing. Make sure to include reproduction steps, and a high level summary of your problem.

Again, I'm sorry, but I can't triage all the various problems in the same issue 😞.

@rwjblue rwjblue closed this as completed Jun 11, 2021
@RobbieTheWagner
Copy link
Author

@rwjblue I seem to still be getting Ember is not defined here https://github.com/shipshapecode/ember-math-helpers/runs/2851158494?check_suite_focus=true

@ef4
Copy link
Contributor

ef4 commented Jun 18, 2021

@rwwagner90 that is most likely due to #862

@RobbieTheWagner
Copy link
Author

@ef4 I don't think I am using window.Ember anywhere, but I suppose it's possible the testing setup does in some way?

@ef4
Copy link
Contributor

ef4 commented Jun 18, 2021

@rwwagner90 one of your addons probably is. It looks like this project is using ember-cli-addon-docs, which pulls in quite a lot of stuff. The CI failure you linked to says

Uncaught ReferenceError: Ember is not defined

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants