Skip to content

fix(cache): log "caches is not defined" only once#4870

Closed
yuintei wants to merge 1 commit intohonojs:mainfrom
yuintei:fix/cache-deduplicate-log
Closed

fix(cache): log "caches is not defined" only once#4870
yuintei wants to merge 1 commit intohonojs:mainfrom
yuintei:fix/cache-deduplicate-log

Conversation

@yuintei
Copy link
Copy Markdown
Contributor

@yuintei yuintei commented Apr 11, 2026

The log is repeated for every cache() call when globalThis.caches is not available. This PR ensures the message is logged only once.

$ vite

  VITE v8.0.0  ready in 675 ms

  ➜  Local:   http://localhost:5173/
  ➜  Network: use --host to expose
  ➜  press h + enter to show help
Cache Middleware is not enabled because caches is not defined.
Cache Middleware is not enabled because caches is not defined.
Cache Middleware is not enabled because caches is not defined.
Cache Middleware is not enabled because caches is not defined.
Cache Middleware is not enabled because caches is not defined.
Cache Middleware is not enabled because caches is not defined.
Cache Middleware is not enabled because caches is not defined.
Cache Middleware is not enabled because caches is not defined.
(repeats...)
Using vars defined in .env

The author should do the following, if applicable

  • Add tests
  • Run tests
  • bun run format:fix && bun run lint:fix to format the code
  • (N/A) Add TSDoc/JSDoc to document the code

@yuintei yuintei force-pushed the fix/cache-deduplicate-log branch from b35bd7f to 66b2c61 Compare April 11, 2026 06:09
@yuintei yuintei closed this Apr 11, 2026
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