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

Mention in the initial content throws error #98

Closed
Mgsy opened this issue Aug 20, 2020 · 1 comment · Fixed by #102
Closed

Mention in the initial content throws error #98

Mgsy opened this issue Aug 20, 2020 · 1 comment · Fixed by #102

Comments

@Mgsy
Copy link
Member

Mgsy commented Aug 20, 2020

Steps to reproduce

  1. Open a sample containing a mention in the initial content (e.g. mentions manual tests).

Current result

The error is thrown

Error

mathtype.js:75 TypeError: Converting circular structure to JSON
    --> starting at object with constructor 'Object'
    |     property 'writer' -> object with constructor 'Writer'
    |     property 'model' -> object with constructor 'Model'
    |     ...
    |     property 'attributes' -> object with constructor 'Object'
    --- property 'mention' closes the circle
    at JSON.stringify (<anonymous>)
    at ce (inspector.js:2)
    at inspector.js:2
    at Array.map (<anonymous>)
    at be (inspector.js:2)
    at inspector.js:2
    at ge (inspector.js:2)
    at inspector.js:2
    at ge (inspector.js:2)
    at inspector.js:2

Notes

It works fine if we load the data without a mention, insert a mention and call editor.setData( editor.getData() ).

@Mgsy Mgsy added the type:bug label Aug 20, 2020
@oleq
Copy link
Member

oleq commented Aug 20, 2020

https://github.com/ckeditor/ckeditor5-inspector/blob/master/src/components/utils.js#L15 is the root of the problem. The question remains what data causes this as it gets stringified.

@oleq oleq added the squad:dx label Sep 15, 2020
@jodator jodator added the intro label Sep 28, 2020
@jodator jodator added this to the nice-to-have milestone Sep 28, 2020
@oleq oleq assigned oleq and unassigned psmyrek Oct 23, 2020
@oleq oleq modified the milestones: nice-to-have, backlog Oct 23, 2020
@Reinmar Reinmar modified the milestones: backlog, iteration 37, iteration 38 Oct 26, 2020
jodator added a commit that referenced this issue Oct 26, 2020
Fix: The inspector should not throw when attributes are objects with circular references. Closes #98.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants