diff --git a/src/vanilla/utils/atomWithStorage.ts b/src/vanilla/utils/atomWithStorage.ts index 5e5c3bac0d1..dc555e9bd9e 100644 --- a/src/vanilla/utils/atomWithStorage.ts +++ b/src/vanilla/utils/atomWithStorage.ts @@ -121,7 +121,7 @@ export function createJSONStorage( if (lastStr !== str) { try { lastValue = JSON.parse(str, options?.reviver) - } catch { + } catch (_e) { return initialValue } lastStr = str @@ -155,7 +155,7 @@ export function createJSONStorage( let newValue: Value try { newValue = JSON.parse(e.newValue || '') - } catch { + } catch (_e) { newValue = initialValue } callback(newValue)