-
Notifications
You must be signed in to change notification settings - Fork 109
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
Could not find module qunit imported from <my-app or addon>/tests/test-helper #436
Comments
Is (Just like in embroider-build/embroider#889, you may be making life unnecessarily hard for yourself by trying to use typescript without using ember-cli-typescript. That is not a well-trodden path.) Please add a console.log or breakpoint here: to see what is in This reminds me vaguely of emberjs/ember-cli-babel#401 also but I don't know if the exact conditions are the same. |
As a workaround you could try: 'ember-cli-babel': {
enableTypeScriptTransform: true,
+ extensions: ['js', 'ts']
}, |
it is! how'd you know? ;)
pre, ember-auto-import/embroider, ember-cli-typescript provided negative value for me/my work because we need to have
well, it's our only option. That said, since both ember-auto-import and embroider switch behaviors based off the presence of
this had no effect, error persists.
I went the console.log route, and it seems it prints multiple times addon: console.log(instance.name, extensions, 'version', version);
I was curious about the extensions setting in the TS projects where I haven't setup ember-cli-typescript (all but one now (maybe ~40))), app: console.log(instance.name, extensions, 'version', version);
what else could it be? the extensions from this list seem to not be the issue (or whatever is looking for test-helper.js/ts isn't using these extensions? |
Maybe TS is not the issue then. The relevant bit is probably not this:
But this:
Because that is probably the dummy app (apps and addons in ember-cli have a different type for Check that the problematic package has followed the ember-qunit migration guide for 5.x. https://github.com/emberjs/ember-qunit/blob/master/docs/migration.md#upgrading-from-v4x-to-v500 By running with |
it has 👍
I had to pipe all this out to a file, because it far surpassed by terminal's buffer history (only 10k lines), results for tests/test-helper
So, it seems like it's being analyzed 🤔 |
Those logs show that the qunit import was found and correctly categorized as going in the tests bundle. Perhaps your tests bundle isn't being loaded at all? Run this (much smaller) log dump: Does your tests/index.html do anything nonstandard to include |
This didn't change any output -- is this an embroider-only DEBUG flag? out of curiosity / guessing at the debug flag conventions, I tried: DEBUG=ember-auto-import:inserter ember build
I see a couple references to test-support.js 🤷 maybe related, maybe not, this addon has a number of
I don't believe so? this looks identical(?) to a new addon's tests/index.html. ( tests/index.html<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Dummy Tests</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
{{content-for "head"}}
{{content-for "test-head"}}
<link rel="stylesheet" href="{{rootURL}}assets/vendor.css">
<link rel="stylesheet" href="{{rootURL}}assets/dummy.css">
<link rel="stylesheet" href="{{rootURL}}assets/test-support.css">
{{content-for "head-footer"}}
{{content-for "test-head-footer"}}
</head>
<body>
{{content-for "body"}}
{{content-for "test-body"}}
<div id="qunit"></div>
<div id="qunit-fixture">
<div id="ember-testing-container">
<div id="ember-testing"></div>
</div>
</div>
<script src="/testem.js" integrity="" data-embroider-ignore></script>
<script src="{{rootURL}}assets/vendor.js"></script>
<script src="{{rootURL}}assets/test-support.js"></script>
<script src="{{rootURL}}assets/dummy.js"></script>
<script src="{{rootURL}}assets/tests.js"></script>
{{content-for "body-footer"}}
{{content-for "test-body-footer"}}
</body>
</html> |
I searched for # in dist/assets
ag "define\(\"qunit"
# -> one result in test-support for qunit-dom/index
ag "define\(\"dummy/tests/test-helper"
# -> one result in tests.js I now understand what you meant by:
|
could this have to do with qunit being in both devDeps and peerDeps? 🤔 |
nope, that's not it. I removed qunit from devDeps and peerDeps, and placed it in deps, and nothing changed 🤔 |
I'm going to close this for now, as I think something "wonky" is going on. In isolation the right thing to do is put qunit in deps or peerdeps, and that works fine. |
So, I had the same issue. Here's my journey: For a very long time I would stay on [email protected] because any newer version would add a wrong path fpr the chunk.js files in my index.html produced by the production build. It would add <script src="/assets/chunk[...]" ></script> instead of <script src="assets/chunk[...]"></script> Notice the extra slash in the upper snippet. This would lead to a 404 error when my app was deployed on a subsite e.g. under Since no one else seemed to have this issue I decided to try out some options. Setting autoImport: {
publicAssetURL: 'assets/'
} in So I changed the snippet in autoImport: {
publicAssetURL: IS_TEST ? "/assets/" : 'assets/'
} with const EmberApp = require("ember-cli/lib/broccoli/ember-app");
const environment = EmberApp.env();
const IS_TEST = (environment === "test"); Now everything works like a charm (so far). Unfortunately I don't quite understand what's going on here. I hope this might help some people and maybe someone can dig in further. Btw, |
@kas1337 that makes sense. I think you need to set |
This is a runtime error that only occurs when visiting
/tests
(and runningember test
)Using: [email protected] (with a bunch of addons using 1.x)
yarn list ember-auto-import
config in ember-cli-build:
The text was updated successfully, but these errors were encountered: