Open drewlee opened 3 years ago
Can you check if the problem was introduced by ember-cli-babel 7.26.5?
@ef4 Negative. The addon is currently using ember-cli-babel v7.26.3.
@drewlee I know we needed to fix this in ember-cognito like this https://github.com/paulcwatts/ember-cognito/pull/161/files my guess is this is because crypto is no longer global?
I debugged this issue a bit with @scalvert today, and we figured out a bit more of what is going on.
The warning RE: crypto
is a red-herring (axe-core only references require('crypto')
in a try/catch + fallback looking for window.crypto
) and can be resolved by adding:
return maybeEmbroider(app, {
packageOptions: {
webpackOptions: {
node: {
crypto: 'empty',
},
},
},
});
The real issue is going to affect more folks than those using axe-core
though. Basically, due to @ember/test-helpers
desire to hook into jQuery
's ajaxSend
and ajaxComplete
and setup test waiters for you when a global jQuery
is present, it checks for window.Ember
and falls back to require('ember')
:
https://github.com/emberjs/ember-test-helpers/blob/master/vendor/monkey-patches.js
When running Ember 3.27+, the ember
module itself doesn't exist at that point which causes the error reported above:
not ok 1 Chrome 90.0 - [undefined ms] - Global error: Uncaught Error: Could not find module `ember` imported from `(require)` at http://localhost:7357/assets/vendor.js, line 256
---
browser log: |
{"type":"error","text":"Uncaught Error: Could not find module `ember` imported from `(require)` at http://localhost:7357/assets/vendor.js, line 256\n","testContext":{}}
A quick-fix for ember-a11y-testing
is to change config/optional-features.json
to set jquery-integration
to false
(@scalvert is doing a PR for this).
ember-a11y-testing is unblocked now (in https://github.com/ember-a11y/ember-a11y-testing/pull/264)
Wow, thanks for looking into this @rwjblue and @scalvert!
The
embroider-safe
andembroider-optimized
scenarios started failing for the ember-a11y-testing addon about 9 days ago. The addon itself didn't have any changes, so these seem to have started failing out of the blue. We're currently using@embroider/test-setup
v0.39.1, but is also reproducible with v0.40.0.ember try:one embroider-safe