Skip to content

STRWEB-156 Gracefully handle a missing favicon - #188

Merged
alb3rtino merged 4 commits into
mainfrom
STRWEB-156
May 7, 2026
Merged

STRWEB-156 Gracefully handle a missing favicon#188
alb3rtino merged 4 commits into
mainfrom
STRWEB-156

Conversation

@alb3rtino

Copy link
Copy Markdown
Contributor

https://folio-org.atlassian.net/browse/STRWEB-156

Purpose

Running yarn start (i.e. stripes serve) in a module repository without a stripes.config.js fails during webpack configuration. The default config does not define branding.favicon.src, and the fallback FAVICON_PATH is resolved relative to the current working directory, where the asset typically does not exist. As a result, developers have to manually create a stripes.config.js or place a favicon at ./tenant-assets/folio-favicon.png to 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 for yarn start. This PR removes that special case and resolves the favicon uniformly across environments.

Approach

  • Introduced resolveFaviconPath helper that returns the configured favicon if it exists, the default FAVICON_PATH if it exists, or the bundled default-assets/favicon.svg otherwise.
  • A configured branding.favicon.src that does not exist still throws, so a typo in a tenant config remains a hard error.
  • Removed the now unused isTesting flag.
  • Updated CHANGELOG.md.

@alb3rtino
alb3rtino requested a review from a team as a code owner May 6, 2026 07:21
@github-actions

github-actions Bot commented May 6, 2026

Copy link
Copy Markdown

Jest Unit Test Results

0 tests  ±0   0 ✅ ±0   0s ⏱️ ±0s
0 suites ±0   0 💤 ±0 
0 files   ±0   0 ❌ ±0 

Results for commit 3075849. ± Comparison against base commit 7a3e84a.

♻️ This comment has been updated with latest results.

@zburke zburke left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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.

Comment thread webpack.config.base.js Outdated
alb3rtino and others added 2 commits May 7, 2026 21:43
@sonarqubecloud

sonarqubecloud Bot commented May 7, 2026

Copy link
Copy Markdown

@alb3rtino
alb3rtino merged commit 512a0d2 into main May 7, 2026
16 checks passed
@alb3rtino
alb3rtino deleted the STRWEB-156 branch May 7, 2026 19:49
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