question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

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!

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
chhoumanncommented, Feb 4, 2022

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;
0reactions
chhoumanncommented, Feb 5, 2022

Hello,

I still get a QuickAdd.app.vault.adapter.getBasePath is not a function error on mobile, with Quickadd 0.5.0. Here is the issue with more details. (see Script 2)

Hi @Elaws,

I’ll respond in the issue you opened. getBasePath is not used in QuickAdd anymore, anywhere, as it doesn’t work on mobile.

Read more comments on GitHub >

github_iconTop Results From Across the Web

TypeError: app.get is not a function - Stack Overflow
But when I use it It throws the error TypeError: app.get is not a function When I remove the prototype part it works....
Read more >
Why does fs.writeFile not save file? - #22 by joethei - Developers ...
To create and overwrite a file, I just use app.vault.adapter.write . To read it if it exists, app.vault.adapter.read . Not sure ...
Read more >
Android apps build failing - Build issue - AppGyver forums
After time more than 7-10 times to create a build, writing the ticket. Unable to build android app. getting this error multiple time...
Read more >
base-magento/CHANGELOG.md at 2.4 · artifakt-io ... - GitHub
(by @BorisovskiP); magento/magento2#26982 -- Remove app/functions.php (by ... Accept HTTP header media type" error message was not informative enough ...
Read more >
2017-April.txt - Jboss List Archives
The SSO aspect of keycloak is not fulfilled since I have to pass username ... are trying to secure our application using the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found