Skip to content

fix(web): guard sessionStorage access for non-browser env - #2

Merged
LingMi1 merged 1 commit into
mainfrom
fix/web-sessionstorage-guard
Aug 17, 2026
Merged

fix(web): guard sessionStorage access for non-browser env#2
LingMi1 merged 1 commit into
mainfrom
fix/web-sessionstorage-guard

Conversation

@LingMi1

@LingMi1 LingMi1 commented Aug 17, 2026

Copy link
Copy Markdown
Owner

Fix npm test failing with sessionStorage is not defined in the Node/vitest environment.

  • Add a sessionStorageAvailable() guard in web/src/api.ts so
    getApiToken/setApiToken no longer reference sessionStorage when
    running outside the browser.
  • Update web/src/api.test.ts to match the new fetchReviews call
    signature ({ headers: {} }).

@LingMi1
LingMi1 merged commit bfdf5c5 into main Aug 17, 2026
6 checks passed
@LingMi1
LingMi1 deleted the fix/web-sessionstorage-guard branch August 17, 2026 07:06
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