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

Does not work: value.rows is undefined #8

Closed
flexchar opened this issue Nov 3, 2020 · 11 comments
Closed

Does not work: value.rows is undefined #8

flexchar opened this issue Nov 3, 2020 · 11 comments

Comments

@flexchar
Copy link

flexchar commented Nov 3, 2020

Whenever I try to add new row/column I keep getting undefined error. I am trying to use inside block editor

@rdunk
Copy link
Owner

rdunk commented Mar 13, 2021

I assume this was an incompatibility introduced in a new Sanity studio version. This might be fixed in #12, but I'll leave it open for the time being.

@schlosser
Copy link

I just installed the latest version, and also get this issue.

Error: Cannot read property '0' of undefined
Check your browser's JavaScript console for details.

The console then shows this stack trace:

Error: Invalid call to useReporter(field-body[_key=="af93d352c45d"]): A component reporting on "field-body[_key=="af93d352c45d"]" is already mounted in the subtree. Make sure that all reporters within the same <Tracker> subtree have unique ids.
    at add (createStore.js:30)
    at createUseReporter.js:42
    at commitHookEffectListMount (react-dom.development.js:19732)
    at commitLifeCycles (react-dom.development.js:19788)
    at commitLayoutEffects (react-dom.development.js:22804)
    at HTMLUnknownElement.callCallback (react-dom.development.js:189)
    at Object.invokeGuardedCallbackDev (react-dom.development.js:238)
    at invokeGuardedCallback (react-dom.development.js:293)
    at commitRootImpl (react-dom.development.js:22542)
    at unstable_runWithPriority (scheduler.development.js:653)

@rdunk
Copy link
Owner

rdunk commented Mar 16, 2021

@schlosser Are you using this with existing data or new data?

@rdunk
Copy link
Owner

rdunk commented Mar 16, 2021

I've just published v2.1.0 as an attempted fix. If you are migrating data from v1 to v2, please follow the configuration instructions in the readme.

@schlosser
Copy link

I was just putting a new table in a blog post, starting with an empty table.

@rdunk
Copy link
Owner

rdunk commented Mar 17, 2021

Ah I see, block text assigns a value by default. I'm able to replicate this, working on a fix.

@rdunk
Copy link
Owner

rdunk commented Mar 18, 2021

Give v2.2.0 a go. I rewrote the entire plugin in TS. It should work correctly with block content now.

@ThomasSchuller
Copy link

ThomasSchuller commented Mar 22, 2021

I get this error after creating a table inside a block editor, closing it and then trying to add another row/column after opening it again.
Error: Cannot add property 2, object is not extensible

However, the plugin works as expected when it is not used with block content. I basically can't edit the table in block content after it is created.

Update:
If I remove a row I can add rows again, but the issue comes back when I try to edit it after.

@flexchar
Copy link
Author

@ThomasSchuller I had error where whole Sanity editor would crash. But updating every package sanity upgrade did seem to help. Maybe will help you too!

@flexchar
Copy link
Author

By the way, thanks for your work @rdunk! It works great!

To mention, I would really love to use it inside block editor and integrate with other editor features such as make text bold/italic etc. I'm not sure if that's up to you or up to Sanity.

@rdunk
Copy link
Owner

rdunk commented Mar 23, 2021

@flexchar Glad to hear it. I think supporting things like richer text as you suggested is a good idea, and would be the next logical step for new features.

@ThomasSchuller Thanks, I'm able to replicate, moved the issue to a separate issue #14.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants