-
-
Notifications
You must be signed in to change notification settings - Fork 712
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug] Spreadsheet become blank with corrupted data in a cell #4338
Comments
datastream should end with \r\n, and you miss "section break" part. A valid data is like this
|
@lumixraku This |
@Jocs Do you have any tips? |
In React’s development mode—especially under Strict Mode—components can go through a “mount → unmount → mount” cycle. This double invocation is intentional and helps detect unintended side effects or memory leaks in components. However, in the case of UniverSheet, its dispose method has a slight delay. During the first unmount, dispose is triggered, and then on the subsequent mount, the sheet is re-created. Because dispose isn’t fully completed before the new creation starts, a bug occurs. To confirm this behavior, you can add a small delay (e.g., using setTimeout) before calling the create logic in the useEffect hook. Doing so ensures the dispose process finishes before the new sheet is created, thereby preventing the bug. You can also add a listener for the DocDisposed event, like so:
Observing the console logs in conjunction with this event will make the execution order clearer and confirm that the dispose completes before the next mount begins. |
Before you submit this issue, have you checked the following
Affected packages and versions
sheets 0.5.1
Reproduction link
I found this issue when a cell data is :
I don't know how the cell data was created, as I was from a user input on a large spreadsheet.
The initial spreadsheet data was created with the
"appVersion":"0.2.14"
but the issue appeared after several spreadsheet edits on0.5.1
.I don't know if the cell data is corrupted or if this is an expected behavior.
Maybe related to #3835
I recreated the error here:
https://stackblitz.com/~/github.com/Blaked84/sheets-vite-demo?file=main.ts
Expected behavior
No error, and a empty cell should be displayed.
Actual behavior
Speadsheet become blank and an error is returned.
System information
The text was updated successfully, but these errors were encountered: