forge42dev/Remix-Dev-Tools

setItem on Storage fails due to exceeding quota

Closed this issue · 1 comments

First, let me state that these tools are super helpful and to thank you for putting this library together. While using the tools, I'm receiving the following error: Failed to execute 'setItem' on 'Storage': Setting the value of 'remixDevTools_state' exceeded the quota., on a particular route for a site that I'm building. This route has multiple charts on it using [scichart[(https://www.scichart.com/). I was able to create a patch using PNPM to temporarily allow the tools to load on this route by updating the setStorageItem function to be:

var setStorageItem = (key, value) => {
  try {
    localStorage.setItem(key, value);
  }
  catch (error) {
    console.log(error);
  }
}

While this isn't the best solution, it does allow me to continue development while waiting for a more permanent solution or maybe you think this is a decent option.

Happy to make a PR to contribute if you'd like.

One thought I originally had before creating a patch was to look for a way to disable the tools on a specific route. Wondering if that's something you think would be a good thing to add.

@jgroh9 To this day I had no idea that set item could throw this exception, after reading the actual definition it indeed mentions that!

I fixed it in the latest version, thank you for this!