nuxt / nuxt/devtools

fix: Adding GeoJSON object to payload with useState freezes browsertab

Open
#936 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
TypeScript
Stars
3.3k
Forks
214
Avg merge
13h 22m
Merged PRs (30d)
18

Description

🐛 The bug

In my application I'm storing some GeoJSON object with useState. I've been experiencing some freezes while developing my application. After some while I noticed they only occurred when de nuxt dev tools are open.

To reproduce in the stackblitz:

  1. Open the dev tools
  2. Go the payload panel
  3. Click addData
  4. The preview frame freezes

In my own application: When I pause script execution in the frozen tab, it seems triggerRef in the handler onUpdateReactivity is being called over and over again.

In the stackblitz I did not find a way to pause the script execution and get meaningful information

🛠️ To reproduce

https://stackblitz.com/edit/github-fkhjhv4b?file=app%2Fapp.vue

🌈 Expected behavior

Adding an GeoJSON to my state while the devtools are open will not freeze the tab

ℹ️ Additional context

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with packages/devtools-kit/src/runtime/iframe-client.ts, focusing on the onUpdateReactivity handler and its triggerRef call. Reproduce the freeze using the linked StackBlitz by opening the devtools payload panel and clicking addData. Done means adding the GeoJSON object to useState no longer freezes the preview frame while devtools are open.

Written by the indexing model from the issue text.

Assessment

Tech stack
nuxt, typescript
Domain
developer-experience, devtools
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.