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

Address warnings in testing about entities-intro.svg #688

Merged
merged 1 commit into from
Jan 13, 2023

Conversation

matthew-white
Copy link
Member

Right now in testing, whenever DatasetIntroduction is rendered, the following warning is shown:

WARN [web-server]: 404: /img/entities-intro.ff844445.svg

For example, that warning is shown after navigating to the datasets page.

Karma doesn't automatically serve our assets, which is why there's a 404. In the past, we've solved this by having Karma serve the asset, then proxying from the location where Frontend expects to find the asset to the location where Karma serves it. I've done something similar here.

There is one way in which the strategy here is different from what we've done in the past. I think we're having webpack process entities-intro.svg, resulting in the hash in the filename and the location of the image at /img rather than /images. I don't think we have webpack process our other assets in the same way. When the icon files change, for example, we manage our own cache-busting in icomoon.css using a query parameter. It's because the webpack-processed image has a hash in its filename that I've included that hash in the Karma proxies option.

I think that's OK, because the image isn't likely to change, so its hash also isn't likely to change. We're also going to try to move away from webpack at some point (#671), so I think we probably don't need to dig too deeply into this. We could maybe also stop having webpack process the image, though I think it's OK that we do. For now, I mostly just wanted to remove these warnings in testing.

This addresses the following warning, which is currently shown in a few
places in testing:

WARN [web-server]: 404: /img/entities-intro.ff844445.svg
Copy link
Contributor

@sadiqkhoja sadiqkhoja left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

perfect

@matthew-white matthew-white merged commit 108a48b into master Jan 13, 2023
@matthew-white matthew-white deleted the image-warning branch January 13, 2023 18:35
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

Successfully merging this pull request may close these issues.

2 participants