quickadd: [BUG] Android - TypeError: app.vault.adapter.getBasePath is not a function

Describe the bug I’m trying to run quickadd on my Android phone. I can find my macro that I’ve created (and verified that it works on desktop) but when I run it I get the following error:

Uncaught (in promise) TypeError: app.vault.adapter.getBasePath is not a function
    at getUserScript (eval at <anonymous> (app.js:1:1), <anonymous>:10399:41)
    at MacroChoiceEngine.executeUserScript (eval at <anonymous> (app.js:1:1), <anonymous>:11554:34)
    at MacroChoiceEngine.executeCommands (eval at <anonymous> (app.js:1:1), <anonymous>:11533:28)
    at MacroChoiceEngine.run (eval at <anonymous> (app.js:1:1), <anonymous>:11526:20)
    at ChoiceExecutor.onChooseMacroType (eval at <anonymous> (app.js:1:1), <anonymous>:15792:27)
    at async ChoiceExecutor.execute (eval at <anonymous> (app.js:1:1), <anonymous>:15768:17)
    at async Object.callback (eval at <anonymous> (app.js:1:1), <anonymous>:15944:21)
getUserScript @ VM515:10399
executeUserScript @ VM515:11554
executeCommands @ VM515:11533
run @ VM515:11526
onChooseMacroType @ VM515:15792
await in onChooseMacroType (async)
LL @ app.js:1
t.onChooseItem @ app.js:1
t.onChooseSuggestion @ app.js:1
t.selectSuggestion @ app.js:1
e.useSelectedItem @ app.js:1
e.onSuggestionClick @ app.js:1
s @ app.js:1

Interestingly I get almost the same error when I try to hit the gear icon for the user script step in my macro.

VM515:10399 Uncaught (in promise) TypeError: app.vault.adapter.getBasePath is not a function
    at getUserScript (eval at <anonymous> (app.js:1:1), <anonymous>:10399:41)
    at UserScriptCommand.configureScript (eval at <anonymous> (app.js:1:1), <anonymous>:14595:28)
    at eval (eval at <anonymous> (app.js:1:1), <anonymous>:224:20)
    at Array.forEach (<anonymous>)
    at eval (eval at <anonymous> (app.js:1:1), <anonymous>:223:31)
    at configureChoice (eval at <anonymous> (app.js:1:1), <anonymous>:13851:3)
    at HTMLSpanElement.click_handler (eval at <anonymous> (app.js:1:1), <anonymous>:13854:30)

To Reproduce Steps to reproduce the behavior:

  1. Open obsidian on and android phone
  2. Open the command pallet
  3. Type the name of your quickadd macro
  4. See error

Expected behavior I expected it to run just like it does on desktop.

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: Windows 10, macOS 11.6.2 (works on both)

Smartphone (please complete the following information):

  • Device: Pixel 3a
  • OS: Android 12
  • Browser: Chrome (latest as of today)
  • Obsidian version 1.0.5

Additional context Let me know if there’s anything else I can offer or explain!

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 15 (4 by maintainers)

Most upvoted comments

Thank you!

Found the issue. It’s line 167. I believe it stops working when it attempts to create a buffer.

I also found a working solution: https://stackoverflow.com/a/26514148 Go to the ‘Cross Browser’ solution and use the Base64 object. Instead of creating a new buffer, you should just encode your credentials, e.g:

// ...
// Remember to grab the Base64 object!
const b = Base64.encode(Settings[API_USER_OPTION] + ":" + Settings[API_PASS_OPTION]);
const auth = "Basic " + b;