inhumantsar / slurp

Slurps webpages and saves them as clean, uncluttered Markdown. Think Pocket, but better.
https://inhumantsar.github.io/slurp/
MIT License
127 stars 2 forks source link

Folder already exists on second "Slurp" #10

Closed Geffreyvanderbos closed 2 months ago

Geffreyvanderbos commented 2 months ago

Description An error occurs when trying to "Slurp" to a custom path in the app. The first attempt to create the folder works, but subsequent attempts result in an "Uncaught (in promise) Error: Folder already exists." error.

Operating System: Windows

Steps to Reproduce:

  1. Open Obsidian and Slurp settings.
  2. Set Default Saved Location to "/Inbox/Slurped".
  3. 'Slurp' a website.
  4. Confirm that the folder and markdown file are created successfully.
  5. Attempt to do another 'slurp'.
  6. The error message appears.

Or

  1. Create the directory set in Default Saved Location manually.
  2. Try a 'slurp'.
  3. The error message appears.

Expected Behavior: The application should add the second slurped webpage to the already existing path.

Error Message: app.js:1 Uncaught (in promise) Error: Folder already exists. at t. (app.js:1:736472) at app.js:1:237056 at Object.next (app.js:1:237161) at a (app.js:1:235879)

inhumantsar commented 2 months ago

hey thanks for the report! that's an odd one. i'm able to reproduce it on my end. looks like when getFolderByPath gets called that second time, Obsidian returns null instead of the directory.

it works for me after removing the leading slash (ie: Inbox/Slurped) though. can you give that a try and let me know if it works for you too?

it's just a workaround ofc, slurp shouldn't barf silently at the first sign of trouble, but it should get you back up and running while i put together a permanent fix.

Geffreyvanderbos commented 2 months ago

Oh silly me. Yes, removing the leading slash works. Also, the update fixed everything I could throw at it. Thank you!