[redux-persist] redux-persist failed to create sync storage. falling back to noop storage.

bunny.log·2022년 10월 11일
0

Remove this code:

import storage from "redux-persist/lib/storage";

Add this code:

import createWebStorage from "redux-persist/lib/storage/createWebStorage";

const createNoopStorage = () => {
  return {
    getItem(_key) {
      return Promise.resolve(null);
    },
    setItem(_key, value) {
      return Promise.resolve(value);
    },
    removeItem(_key) {
      return Promise.resolve();
    },
  };
};

const storage =
  typeof window !== "undefined"
    ? createWebStorage("local")
    : createNoopStorage();

동영상을 보면서 하면 더 쉬워요

https://www.youtube.com/watch?v=fjPIJZ1Eokg

참고
https://www.youtube.com/watch?v=fjPIJZ1Eokg
https://mightycoders.xyz/redux-persist-failed-to-create-sync-storage-falling-back-to-noop-storage

profile
https://github.com/nam-yeun-hwa

0개의 댓글