zsviczian / obsidian-excalidraw-plugin

A plugin to edit and view Excalidraw drawings in Obsidian
4.23k stars 233 forks source link

BUG: Insert File Broken for *.excalidraw (non-markdown) files. #1686

Open moonbyte13 opened 7 months ago

moonbyte13 commented 7 months ago

Your environment Please run Command Palette/Show Debug info in Obsidian and paste the result here. SYSTEM INFO: Obsidian version: v1.5.12 Installer version: v1.5.8 Operating system: Windows 10 Home 10.0.19045 Login status: logged in Catalyst license: none Insider build toggle: off Live preview: on Base theme: adapt to system Community theme: none Snippets enabled: 1 Restricted mode: off Plugins installed: 12 Plugins enabled: 5 1: Advanced Tables v0.21.0 2: Style Settings v1.0.8 3: Unicode Search v0.5.0 4: File Color v1.1.0 5: Excalidraw v2.1.1

RECOMMENDATIONS: Custom theme and snippets: for cosmetic issues, please first try updating your theme and disabling your snippets. If still not fixed, please try to make the issue happen in the Sandbox Vault or disable community theme and snippets. Community plugins: for bugs, please first try updating all your plugins to latest. If still not fixed, please try to make the issue happen in the Sandbox Vault or disable community plugins.

Describe the bug A clear and concise description of what the bug is. After updating Excalidraw to v2.1.1, everytime I try to import/insert a pdf into Excalidraw it does not open the modal to select "import as pdf" or "import as embedded". Instead it sits on an empty container. I have tried restarting my computer, disabling Excalidraw and renabling it but still could not get the modal to open.

To Reproduce Steps to reproduce the behavior:

  1. Go to an Excalidraw drawing
  2. Click on "Insert ANY File"
  3. See no response

Expected behavior A clear and concise description of what you expected to happen. The expected behavior is a modal that should open asking the user some import settings etc.

Screenshots If applicable, add screenshots to help explain your problem. image In the image above it shows an error in the Developer Tools Uncaught (in promise) TypeError: Cannot read properties of null (reading 'blocks') at UniversalInsertFileModal.createForm (plugin:obsidian-excalidraw-plugin:97:325734). This shows that there is an error trying to open the Excalidraw "Insert Any File" modal.

Additional context Add any other context about the problem here. Plz fix, I need my notes for school.

Love your work <3

moonbyte13 commented 7 months ago

It seems to only be an issue with the *.excalidraw file format. image For some reason it works with the regular .excalidraw file format. image

zsviczian commented 7 months ago

I'll take a look.

BTW unless you have some very strong compatibility requirements of using Obsidian and another tool (e.g. Visual Studio) on the same folder, I advise against using the .excalidraw format. Because I don't use it myself I practically never test it, and do not really maintain those features. They should work, but definitely not my focus.