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

Fresh app 404's on missing assets/test-support.css #10428

Open
nickschot opened this issue Jan 23, 2024 · 8 comments
Open

Fresh app 404's on missing assets/test-support.css #10428

nickschot opened this issue Jan 23, 2024 · 8 comments

Comments

@nickschot
Copy link
Contributor

Generating a fresh ember 5.5 app results in the following error.

image

This is likely due to ember-qunit now being a v2 addon (it internally handles it's styles with a JS import). Probably the blueprint needs to have the <link rel="stylesheet" href="{{rootURL}}assets/test-support.css"> import removed?

@jrjohnson
Copy link
Contributor

jrjohnson commented Jan 25, 2024

I was just trying to figure out where this gets built from. I'm pretty sure it's used somehow in ember-a11y-testing as invocations of a11yAudit come with 404s every time looking for this file.

Edit - never mind this comes from axe-core and can be turned off with

//test-helpers.js
import { setRunOptions } from 'ember-a11y-testing/test-support';

setRunOptions({
  preload: false,
});

@kategengler
Copy link
Member

@NullVoxPopuli any thoughts?

@NullVoxPopuli
Copy link
Contributor

NullVoxPopuli commented Feb 8, 2024

It does seem like a bug with ember-cli.

Like, since ember-cli is the convention based build tool, it should probably gracefully fallback to an empty file for test-support.js, and log a message saying that no v1 addons put any content into it

At the same time, if ember-qunit was the only producer of test-support content, i think it's totally legit to just remove the entry from index.html

@kategengler
Copy link
Member

I don't see this on v5.7.0 or v5.5.0, is there something more specific than a new app to recreate it?

@sly7-7
Copy link

sly7-7 commented Apr 19, 2024

FWIW I've just created an addon following https://github.com/embroider-build/addon-blueprint?tab=readme-ov-file (I wanted to try to migrate my private addon to v2).
I have this error in the console when running the tests:
Capture d’écran 2024-04-19 à 14 06 43
I don't know what is supposed to create this file, but as @NullVoxPopuli said, I guess I can just remove this file in the index.html

@nickschot
Copy link
Contributor Author

I don't see this on v5.7.0 or v5.5.0, is there something more specific than a new app to recreate it?

I just tried again, simply generating a new app with the latest ember-cli (5.8) through ember new -> ember s -> visit localhost:4200/tests, it'll show an error for the test-support.css file. I think indeed we can simply remove it from the index.html blueprint.

@mansona
Copy link
Member

mansona commented Apr 22, 2024

So we've been looking at this area recently because of the Embroider upgrades, and I think the ember-cli behaviour is to not generate a test-support.css file if there are no addons that inject things (via classic addon behaviour). I suspect that this is happening now because there are no longer any addons that inject things into test-support.css, maybe ember-qunit recently changed to a v2 addon?

I don't know that we should just remove it from the blueprint, I think the better solution would be to generate it even when it is going to be empty, what do we think?

@nickschot
Copy link
Contributor Author

So we've been looking at this area recently because of the Embroider upgrades, and I think the ember-cli behaviour is to not generate a test-support.css file if there are no addons that inject things (via classic addon behaviour). I suspect that this is happening now because there are no longer any addons that inject things into test-support.css, maybe ember-qunit recently changed to a v2 addon?

I don't know that we should just remove it from the blueprint, I think the better solution would be to generate it even when it is going to be empty, what do we think?

The only addons I knew of using this were ember-mocha (unsupported/deprecated) and ember-qunit before v2 conversion. Could be that there's others around indeed, so seems better.

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

6 participants