holxsam / tldraw-in-obsidian

A plugin to integrate Tldraw into Obsidian.
Apache License 2.0
121 stars 6 forks source link

Copy from web does not work with 1.0.6 #23

Open jannikbuschke opened 2 weeks ago

jannikbuschke commented 2 weeks ago

Just tried with the new 1.0.6 release to copy simple text content from a tldraw.com web page to the plugin hosted in Obsidian. With right click > paste, or ctrl+v nothing happens. In the console the following error is shown:

plugin:tldraw:32891 Error migrating store Incompatible schema?
migrateStoreSnapshot @ plugin:tldraw:32891
putContentOntoCurrentPage @ plugin:tldraw:54074
pasteTldrawContent @ plugin:tldraw:76585
handleClipboardThings @ plugin:tldraw:76855
await in handleClipboardThings (async)
handlePasteFromClipboardApi @ plugin:tldraw:76763
onPaste @ plugin:tldraw:76969
eval @ plugin:tldraw:78391
Promise.then (async)
onSelect @ plugin:tldraw:78390
onSelect @ plugin:tldraw:82867
menuItem.addEventListener.once @ plugin:tldraw:81845
eval @ plugin:tldraw:72229
flushSync3 @ plugin:tldraw:20874
flushSync$1 @ plugin:tldraw:23451
$8927f6f2acc4f386$export$6d1a0317bde7de7f @ plugin:tldraw:72228
handleSelect @ plugin:tldraw:81850
handleEvent @ plugin:tldraw:71878
callCallback2 @ plugin:tldraw:5602
invokeGuardedCallbackDev @ plugin:tldraw:5627
invokeGuardedCallback @ plugin:tldraw:5661
invokeGuardedCallbackAndCatchFirstError @ plugin:tldraw:5664
executeDispatch @ plugin:tldraw:8944
processDispatchQueueItemsInOrder @ plugin:tldraw:8964
processDispatchQueue @ plugin:tldraw:8973
dispatchEventsForPlugins @ plugin:tldraw:8981
eval @ plugin:tldraw:9105
batchedUpdates$1 @ plugin:tldraw:20837
batchedUpdates @ plugin:tldraw:5507
dispatchEventForPluginEventSystem @ plugin:tldraw:9104
dispatchEventWithEnableCapturePhaseSelectiveHydrationWithoutDiscreteEventReplay @ plugin:tldraw:7406
dispatchEvent @ plugin:tldraw:7400
dispatchDiscreteEvent @ plugin:tldraw:7377
plugin:tldraw:54076 Uncaught (in promise) Error: Could not put content: could not migrate content
    at Editor.putContentOntoCurrentPage (plugin:tldraw:54076:13)
    at pasteTldrawContent (plugin:tldraw:76585:10)
    at handleClipboardThings (plugin:tldraw:76855:7)
    at async handlePasteFromClipboardApi (plugin:tldraw:76763:10)

Thank you for this plugin, very valuable! 🙏

jon-dez commented 2 weeks ago

18 was closed, but it doesn't seem that the problem was specifically fixed. I'll note down my observations until I get around to it or someone else does:

Firefox:

Copy/pasting from or to Firefox doesn't work, at least on version 127.0. This seems to be a Firefox specific feature so keep that in mind if you use Firefox. There is an issue on the main Tldraw repo: https://github.com/tldraw/tldraw/issues/3949

Chromium based browsers:

Copy and pasting from the tldraw obsidian plugin to tldraw in the chromium based browser does work. Copy and pasting from the browser into obsidian does not work

Pasting using CTRL+V

Error 1

plugin:tldraw:32891 Error migrating store Incompatible schema?
migrateStoreSnapshot @ plugin:tldraw:32891
putContentOntoCurrentPage @ plugin:tldraw:54074
pasteTldrawContent @ plugin:tldraw:76585
handleClipboardThings @ plugin:tldraw:76855
await in handleClipboardThings (async)
handlePasteFromEventClipboardData @ plugin:tldraw:76723
paste @ plugin:tldraw:77028

Error 2

plugin:tldraw:54076 Uncaught (in promise) Error: Could not put content: could not migrate content
    at Editor.putContentOntoCurrentPage (plugin:tldraw:54076:13)
    at pasteTldrawContent (plugin:tldraw:76585:10)
    at handleClipboardThings (plugin:tldraw:76855:7)
putContentOntoCurrentPage @ plugin:tldraw:54076
pasteTldrawContent @ plugin:tldraw:76585
handleClipboardThings @ plugin:tldraw:76855
await in handleClipboardThings (async)
handlePasteFromEventClipboardData @ plugin:tldraw:76723
paste @ plugin:tldraw:77028

Pasting using the context menu (right click -> Paste)

Error 1

plugin:tldraw:32891 Error migrating store Incompatible schema?
migrateStoreSnapshot @ plugin:tldraw:32891
putContentOntoCurrentPage @ plugin:tldraw:54074
pasteTldrawContent @ plugin:tldraw:76585
handleClipboardThings @ plugin:tldraw:76855
await in handleClipboardThings (async)
handlePasteFromClipboardApi @ plugin:tldraw:76763
onPaste @ plugin:tldraw:76969
eval @ plugin:tldraw:78391
Promise.then (async)
onSelect @ plugin:tldraw:78390
onSelect @ plugin:tldraw:82867
menuItem.addEventListener.once @ plugin:tldraw:81845
eval @ plugin:tldraw:72229
flushSync3 @ plugin:tldraw:20874
flushSync$1 @ plugin:tldraw:23451
$8927f6f2acc4f386$export$6d1a0317bde7de7f @ plugin:tldraw:72228
handleSelect @ plugin:tldraw:81850
handleEvent @ plugin:tldraw:71878
callCallback2 @ plugin:tldraw:5602
invokeGuardedCallbackDev @ plugin:tldraw:5627
invokeGuardedCallback @ plugin:tldraw:5661
invokeGuardedCallbackAndCatchFirstError @ plugin:tldraw:5664
executeDispatch @ plugin:tldraw:8944
processDispatchQueueItemsInOrder @ plugin:tldraw:8964
processDispatchQueue @ plugin:tldraw:8973
dispatchEventsForPlugins @ plugin:tldraw:8981
eval @ plugin:tldraw:9105
batchedUpdates$1 @ plugin:tldraw:20837
batchedUpdates @ plugin:tldraw:5507
dispatchEventForPluginEventSystem @ plugin:tldraw:9104
dispatchEventWithEnableCapturePhaseSelectiveHydrationWithoutDiscreteEventReplay @ plugin:tldraw:7406
dispatchEvent @ plugin:tldraw:7400
dispatchDiscreteEvent @ plugin:tldraw:7377

Error 2

plugin:tldraw:54076 Uncaught (in promise) Error: Could not put content: could not migrate content
    at Editor.putContentOntoCurrentPage (plugin:tldraw:54076:13)
    at pasteTldrawContent (plugin:tldraw:76585:10)
    at handleClipboardThings (plugin:tldraw:76855:7)
    at async handlePasteFromClipboardApi (plugin:tldraw:76763:10)
putContentOntoCurrentPage @ plugin:tldraw:54076
pasteTldrawContent @ plugin:tldraw:76585
handleClipboardThings @ plugin:tldraw:76855
await in handleClipboardThings (async)
onPaste @ plugin:tldraw:76969
eval @ plugin:tldraw:78391
Promise.then (async)
onSelect @ plugin:tldraw:78390
onSelect @ plugin:tldraw:82867
menuItem.addEventListener.once @ plugin:tldraw:81845
eval @ plugin:tldraw:72229
flushSync3 @ plugin:tldraw:20874
flushSync$1 @ plugin:tldraw:23451
$8927f6f2acc4f386$export$6d1a0317bde7de7f @ plugin:tldraw:72228
handleSelect @ plugin:tldraw:81850
handleEvent @ plugin:tldraw:71878
callCallback2 @ plugin:tldraw:5602
invokeGuardedCallbackDev @ plugin:tldraw:5627
invokeGuardedCallback @ plugin:tldraw:5661
invokeGuardedCallbackAndCatchFirstError @ plugin:tldraw:5664
executeDispatch @ plugin:tldraw:8944
processDispatchQueueItemsInOrder @ plugin:tldraw:8964
processDispatchQueue @ plugin:tldraw:8973
dispatchEventsForPlugins @ plugin:tldraw:8981
eval @ plugin:tldraw:9105
batchedUpdates$1 @ plugin:tldraw:20837
batchedUpdates @ plugin:tldraw:5507
dispatchEventForPluginEventSystem @ plugin:tldraw:9104
dispatchEventWithEnableCapturePhaseSelectiveHydrationWithoutDiscreteEventReplay @ plugin:tldraw:7406
dispatchEvent @ plugin:tldraw:7400
dispatchDiscreteEvent @ plugin:tldraw:7377