You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a PortableText area has a code type block, and the window is unmounted for whatever reason (switching to another post, or closing the editor pane), Slate throws up an error.
Changes seem to be saved successfully 👍
But the error is quite "loud" 😔
To Reproduce
Go to a post with a code block on it
Make sure the PortableTextEditor is active by clicking on it
Switch to a different post OR close the editor pane
See error
Expected behavior
No error should be shown
Screenshots
codeinput-bug.mp4
Which versions of Sanity are you using?
@sanity/cli (global) 4.6.1 (up to date)
@sanity/code-input 6.0.1 (up to date)
@sanity/eslint-config-studio 5.0.2 (up to date)
sanity 4.6.1 (up to date)
What operating system are you using?
macOS 15.6.1
Which versions of Node.js / npm are you running?
Run npm -v && node -v in the terminal and copy-paste the result here.
10.9.2
v22.17.1
Additional context
I tested reverting Sanity back a few versions, and the issue looks like it started since v4.1.0
Describe the bug
When a PortableText area has a
codetype block, and the window is unmounted for whatever reason (switching to another post, or closing the editor pane), Slate throws up an error.To Reproduce
codeblock on itExpected behavior
No error should be shown
Screenshots
codeinput-bug.mp4
Which versions of Sanity are you using?
What operating system are you using?
macOS 15.6.1Which versions of Node.js / npm are you running?
Run
npm -v && node -vin the terminal and copy-paste the result here.Additional context
I tested reverting Sanity back a few versions, and the issue looks like it started since
v4.1.0It seems to be happy on
v4.0.1GitHub reduced reproduction project
I've made a reduced bug repro here if it helps
https://github.com/indeox/sanity-codeinput-bug-repro
Hope this helps track it down. Happy to help in any way possible 🤗