plasmo icon indicating copy to clipboard operation
plasmo copied to clipboard

[BUG] Data is not being stored in localStorage using Plasmo Storage

Open thiagolmoraes opened this issue 5 months ago • 1 comments

What happened?

Trying to use the Storage API in all ways but it doesn't work or no error message appears

import { Storage } from "@plasmohq/storage";
const storage = new Storage();

function Index() {


  useEffect(() => {
    const setAndGetData = async () => {
      try {
        await storage.set("key", "value");
        const data = await storage.get("key"); // "value"
        console.log(data);
      } catch (error) {
        console.log(error);
      }
    };
    setAndGetData();
  }, []);

Version

npm 8.19.4 node v16.20.2

Latest

What OS are you seeing the problem on?

Linux

What browsers are you seeing the problem on?

Chrome

Relevant log output

No response

(OPTIONAL) Contribution

  • [ ] I would like to fix this BUG via a PR

Code of Conduct

  • [X] I agree to follow this project's Code of Conduct
  • [X] I checked the current issues for duplicate problems.

thiagolmoraes avatar Sep 10 '24 01:09 thiagolmoraes