Skip to content
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] Runtime Error when using save() to get snapshot in a sheet that have a chart #4575

Open
2 tasks done
kubothegsd opened this issue Jan 26, 2025 · 4 comments
Open
2 tasks done
Assignees
Labels
bug Something isn't working

Comments

@kubothegsd
Copy link

kubothegsd commented Jan 26, 2025

Before you submit this issue, have you checked the following

  • Is this really a problem?
  • I have searched the Github Issues for similar issues, but did not find anything.

Affected packages and versions

0.5.5

Reproduction link

I set up a sheet with a chart using the preset

presets: [
     UniverSheetsAdvancedPreset({
        license: <'txt content'>,
      }),
]

Image

Then I use the save() method to get a snapshot

const activeWorkbook = univerAPI.getActiveWorkbook();
const snapshot = activeWorkbook.save();

Expected behavior

Should get a snapshot as normal without throwing exception

Actual behavior

Unhandled Runtime Error
TypeError: Converting circular structure to JSON
--> starting at object with constructor 'SafeSubscriber'
| property '_finalizers' -> object with constructor 'Array'
| index 0 -> object with constructor 'OperatorSubscriber'
--- property '_parentage' closes the circle

Call Stack
JSON.stringify
<anonymous>
k._serializeChartForUnit
webpack-internal:/node_modules/.pnpm/@[email protected]_@[email protected][email protected][email protected]/node_modules/@univerjs-pro/sheets-chart/lib/es/index.js
Object.toJson
webpack-internal:/node_modules/.pnpm/@[email protected]_@[email protected][email protected][email protected]/node_modules/@univerjs-pro/sheets-chart/lib/es/index.js
eval
webpack-internal:/node_modules/.pnpm/@[email protected]_@[email protected][email protected][email protected]/node_modules/@univerjs/core/lib/es/index.js
Array.map
<anonymous>
VE.getResourcesByType
webpack-internal:/node_modules/.pnpm/@[email protected]_@[email protected][email protected][email protected]/node_modules/@univerjs/core/lib/es/index.js
VE.getResources
webpack-internal:/node_modules/.pnpm/@[email protected]_@[email protected][email protected][email protected]/node_modules/@univerjs/core/lib/es/index.js
ui.saveUnit
webpack-internal:/node_modules/.pnpm/@[email protected]_@[email protected][email protected][email protected]/node_modules/@univerjs/core/lib/es/index.js
f.save
webpack-internal:/node_modules/.pnpm/@[email protected]_@[email protected][email protected][email protected]/node_modules/@univerjs/sheets/lib/es/facade.js

System information

Using Trial License in JavaScript/TypeScript Projects (without server)

@univer-bot univer-bot bot added the bug Something isn't working label Jan 26, 2025
@VicKun4937 VicKun4937 self-assigned this Jan 26, 2025
@VicKun4937
Copy link
Contributor

sorry , can you create a demo to reproduce this problem, I can't reproduce this one.

@kubothegsd
Copy link
Author

This is the demo. https://stackblitz.com/~/github.com/kubothegsd/sheets-vite-demo

snapshot_error.mp4

Thanks for helping, @VicKun4937

@VicKun4937
Copy link
Contributor

thank you for your reproduce, it really a bug , and we will fix it in next version.

And I find that you only have three types of chart, you can test it with a license , you can get more support chart type. As you know , Chinese New Year is coming, may be you question can't be replied timely. You can leave messages in git or discard, we will answer you later days.

@VicKun4937
Copy link
Contributor

It is caused by local reference in json, fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants