STRWEB-156 Gracefully handle a missing favicon - #188
Merged
Conversation
zburke
approved these changes
May 7, 2026
zburke
left a comment
Member
There was a problem hiding this comment.
Thanks, @alb3rtino, for continuing the clean up process for the bugs I introduced in #179 for STCOR-151. @JohnC-80 got us half-way there in #184; hopefully this is the final fix.
Co-authored-by: Zak Burke <zburke@ebsco.com>
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



https://folio-org.atlassian.net/browse/STRWEB-156
Purpose
Running
yarn start(i.e.stripes serve) in a module repository without astripes.config.jsfails during webpack configuration. The default config does not definebranding.favicon.src, and the fallbackFAVICON_PATHis resolved relative to the current working directory, where the asset typically does not exist. As a result, developers have to manually create astripes.config.jsor place a favicon at./tenant-assets/folio-favicon.pngto start a module locally.#184 worked around this for the test environment by suppressing the missing-favicon error when
NODE_ENV === 'test', but the underlying issue remains foryarn start. This PR removes that special case and resolves the favicon uniformly across environments.Approach
resolveFaviconPathhelper that returns the configured favicon if it exists, the defaultFAVICON_PATHif it exists, or the bundleddefault-assets/favicon.svgotherwise.branding.favicon.srcthat does not exist still throws, so a typo in a tenant config remains a hard error.isTestingflag.CHANGELOG.md.