Skip to content

STRWEB-156 Gracefully handle a missing favicon - #187

Closed
alb3rtino wants to merge 2 commits into
folio-org:mainfrom
alb3rtino:STRWEB-156
Closed

STRWEB-156 Gracefully handle a missing favicon#187
alb3rtino wants to merge 2 commits into
folio-org:mainfrom
alb3rtino:STRWEB-156

Conversation

@alb3rtino

@alb3rtino alb3rtino commented Apr 29, 2026

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 April 29, 2026 12:56
@alb3rtino alb3rtino closed this May 6, 2026
@alb3rtino

Copy link
Copy Markdown
Contributor Author

Moved to #188

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.

1 participant