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

Error when trying to run tests: unsupported module was defined #677

Closed
Turbo87 opened this issue Feb 5, 2021 · 8 comments
Closed

Error when trying to run tests: unsupported module was defined #677

Turbo87 opened this issue Feb 5, 2021 · 8 comments

Comments

@Turbo87
Copy link
Collaborator

Turbo87 commented Feb 5, 2021

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 64

mainmatter/qunit-dom#970 is trying to update the embroider dependency in qunit-dom, but it fails with the above error and ember test ultimately timing out.

The stack trace of the error is pointing to emberjs/ember-test-helpers#958 being the problem. It looks like the es6-promise import there is not working correctly.

Note that this only happens in combination with the new ember-qunit v5 setup. With ember-qunit v4 this is not an issue because the test-helpers PR above was only added in v2.x, which is not used by ember-qunit v4.

/cc @rwjblue @ef4

bors added a commit to rust-lang/crates.io that referenced this issue Feb 7, 2021
CI: Disable `yarn test` command for `embroider` job

We are running into a similar issue to what is described at embroider-build/embroider#677. We currently allow the CI step to fail, but since it waits until it times out it keeps the PRs in "running" state for an unnecessarily long time.

This PR is changing the CI to only build, but not run the tests, with embroider to avoid the above issue. Once embroider-build/embroider#677 is addressed we can revert this change again.

r? `@locks`
rwjblue added a commit to emberjs/ember-test-helpers that referenced this issue Feb 17, 2021
The UMD wrapping that was used by es6-promise was causing issues in
certain contexts (see embroider-build/embroider#677).

This moves from es6-promise to the same promise polyfill that is used by
qunit@2.14.0 and higher (promise-polyfill@8.2.0 with some tweaks).
rwjblue added a commit to emberjs/ember-test-helpers that referenced this issue Feb 17, 2021
The UMD wrapping that was used by es6-promise was causing issues in
certain contexts (see embroider-build/embroider#677).

This moves from es6-promise to the same promise polyfill that is used by
qunit@2.14.0 and higher (promise-polyfill@8.2.0 with some tweaks).
@ctjhoa
Copy link

ctjhoa commented Apr 1, 2021

Looks like I have a very similar issue in this PR:
zestia/ember-select-box#32

The weird thing is:

  • if I run CI=true node_modules/.bin/ember try:one embroider-safe => build is KO
  • if I run without the CI env variable node_modules/.bin/ember try:one embroider-safe => build is fine

Here is an example of build failure log:
https://travis-ci.org/github/zestia/ember-select-box/jobs/765467368

node : v10.24.0
@ember/test-helpers : 2.2.5
ember-qunit : 5.1.4
@embroider/test-setup: ^0.39.1
@embroider/util: ^0.39.1

sandydoo added a commit to sandydoo/ember-google-maps that referenced this issue Apr 2, 2021
@ef4
Copy link
Contributor

ef4 commented Apr 4, 2021

This is due to #731 (comment)

You can use embroider's skipBabel option to workaround.

skipBabel: [
  {
    package: 'qunit',
  },
],

@mansona
Copy link
Member

mansona commented Apr 13, 2021

I'm getting a similar error but I have tried the skipBabel trick 🤔

Here is the error: https://github.com/mansona/ember-cli-notifications/pull/308/checks?check_run_id=2332566153#step:5:80 and here is where we added the skipBabel mansona/ember-cli-notifications@cf9057e

Am I missing something? 🤔

@ctjhoa
Copy link

ctjhoa commented Apr 13, 2021

In @mansona case,
there was a missing explicit dependency to ember-auto-import.
mansona/ember-cli-notifications#310

pangratz added a commit to effective-ember/ember-showcase that referenced this issue May 17, 2021
pangratz added a commit to effective-ember/ember-showcase that referenced this issue May 17, 2021
LevelbossMike pushed a commit to effective-ember/ember-showcase that referenced this issue May 17, 2021
simonihmig added a commit to ember-bootstrap/ember-bootstrap that referenced this issue May 20, 2021
@simonihmig
Copy link
Collaborator

I pulled my hairs out because of this, as everything was working fine locally, but only failing in CI. Turned out I forgot (once again) that you would need to set CI=true locally to actually replicate what's happing in CI. 🤦‍♂️. Glad I found this issue here now, but took me a while...

I think we need to prevent this experience from happening for other users:

  • should we add the skipBabel config to the default blueprint for addons here?
  • or should maybeEmbroider() handle this implicitly, by enforcing that config internally for qunit. Or maybe just when it detects IE in the targets of the app that is passed to it?

@rwjblue
Copy link
Collaborator

rwjblue commented May 20, 2021

@simonihmig - Ya, I think we should make the addon blueprint do the same as the app blueprint

https://github.com/ember-cli/ember-cli/blob/dae8449a4035144df423661385c6902f2ce7911b/blueprints/app/files/ember-cli-build.js#L24-L29

@stefanpenner
Copy link
Collaborator

es6-promise is also effected by this

@Turbo87
Copy link
Collaborator Author

Turbo87 commented Dec 7, 2021

not sure what exactly solved this, but it appears to work fine now for crates.io

@Turbo87 Turbo87 closed this as completed Dec 7, 2021
Turbo87 added a commit to Turbo87/crates.io that referenced this issue Dec 7, 2021
Turbo87 added a commit to Turbo87/crates.io that referenced this issue Dec 7, 2021
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