Describe the bug
The following error is raised when pasting text from the clipboard to a nested portable text field:
Stack trace:
Error: Cannot apply deep operations on primitive values. Received patch with type "unset" and path "[object Object] that targeted the value "undefined"
at apply (/static/js/app.bundle.js:328620:11)
at applyPatch (/static/js/app.bundle.js:120833:33)
at _apply (/static/js/app.bundle.js:120837:13)
at apply (/static/js/app.bundle.js:328517:45)
at applyPatch (/static/js/app.bundle.js:120830:32)
at _apply (/static/js/app.bundle.js:120837:13)
at Array.reduce (<anonymous>)
at applyAll (/static/js/app.bundle.js:120817:18)
at patchBlockData (/static/js/app.bundle.js:328031:48)
at ProxyComponent.patchToOperations (/static/js/app.bundle.js:328214:14)
To Reproduce
Screenshots

Which versions of Sanity are you using?
@sanity/cli 0.140.9 (latest: 0.140.11)
@sanity/base 0.140.11 (up to date)
@sanity/code-input 0.140.10 (up to date)
@sanity/components 0.140.11 (up to date)
@sanity/core 0.140.11 (up to date)
@sanity/default-layout 0.140.11 (up to date)
@sanity/default-login 0.140.3 (up to date)
@sanity/desk-tool 0.140.11 (up to date)
@sanity/storybook 0.140.3 (up to date)
@sanity/vision 0.140.11 (up to date)
What operating system are you using?
Mac OS 10.14.3
Which versions of Node.js / npm are you running?
6.4.1
v10.14.1
Additional context
Plain text has been copied from a HTML form field.
Document schema:
export default {
name: 'test',
title: 'Test',
type: 'document',
fields: [
{
name: 'title',
title: 'Title',
type: 'string',
},
{
title: 'Body',
name: 'body',
type: 'array',
of: [
{ type: 'block' },
{
title: 'Custom Image',
name: 'customImage',
type: 'object',
fields: [
{
title: 'Image',
name: 'image',
type: 'image',
},
{
title: 'Text',
name: 'text',
type: 'text',
},
{
title: 'Portable Text',
name: 'portableText',
type: 'array',
of: [{ type: 'block' }],
},
],
},
],
},
]
}
Potentially also related to https://github.com/sanity-io/sanity-plugin-mux-input/issues/1?
I believe this is fixed now. I'm not able to reproduce the error at least. Was this perhaps fixed in 0.140.12 @skogsmaskin?
Unfortunately I'm still seeing this in 0.140.12
Interestingly enough, the error is reproducible for me when I immediately paste text into the nested portable text field. If I enter any copy beforehand before pasting, it works as expected! GIF below:

It was fixed last week, but it's not released yet. Hopefully this week. Thanks for reporting!
Most helpful comment
It was fixed last week, but it's not released yet. Hopefully this week. Thanks for reporting!