silverbulletmd / silverbullet

The knowledge tinkerer's notebook
https://silverbullet.md
MIT License
2.35k stars 169 forks source link

Type Error; page doesn't load #806

Closed vsl-iil closed 6 months ago

vsl-iil commented 6 months ago

Every access to Silverbullet produces following error in logs:

TypeError: Failed to execute 'set' on 'Headers': Argument 2 is not a valid ByteString
    at makeException (ext:deno_webidl/00_webidl.js:91:10)
    at Array.converters.ByteString (ext:deno_webidl/00_webidl.js:419:11)
    at Headers.set (ext:deno_fetch/20_headers.js:412:44)
    at NR.newResponse (https://get.silverbullet.md/:110:2132)
    at NR.json (https://get.silverbullet.md/:110:2651)
    at https://get.silverbullet.md/:163:9942
    at eventLoopTick (ext:core/01_core.js:169:7)
    at async c (https://get.silverbullet.md/:110:4231)
    at async https://get.silverbullet.md/:110:21405
    at async c (https://get.silverbullet.md/:110:4231)

The contents of index.md don't show up (they flash for a sec and then disappear), "Open page" and "Run command" buttons don't work as well.

Deno version:

deno 1.41.2 (release, aarch64-unknown-linux-gnu)
v8 12.1.285.27
typescript 5.3.3

Silverbullet version:

silverbullet 0.7.5

uname -a:

Linux x-pc 6.1.31-1+ #1 SMP Tue Jul 11 18:46:02 CST 2023 aarch64 GNU/Linux

Command used to run Silverbullet: silverbullet -L0.0.0.0 -p 3003 $HOME/documents/silverbullet/

zefhemel commented 6 months ago

This is very odd. The $HOME/documents/silverbullet/ does in fact exist, right? And the silverbullet process has read/write access to that folder and its files?

vsl-iil commented 6 months ago

Yes, this directory exists and Silverbullet does, in fact, have access to it, as index.md and SETTINGS.md files are being created. I ran chmod -R 777 just in case, but it didn't help. Error only occurs when I open silverbullet in browser.

zefhemel commented 6 months ago

Very peculiar. Not sure if this will make a difference, but would you mind switching to an edge build? Instructions are here (you can try the Deno version): https://community.silverbullet.md/t/living-on-the-edge-builds/27

vsl-iil commented 6 months ago

Oh, I think I found the solution! I may not have been entirely sincere and included a mocked-up directory path (silly, I know) - it actually contains Cyrillic ($HOME/Документы/silverbullet). I moved the space up a directory, so the path is fully ASCII, and it works perfectly now. :)

zefhemel commented 6 months ago

Hah. Indeed. It will send the path in a header, which may indeed break if it cannot encode it. That's an edge case I never considered.

Happy you managed to work around it.