Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(examples): pass string into editor, not buffer #339

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

joepie91
Copy link

@joepie91 joepie91 commented Feb 4, 2023

Code originally attempts to pass a Buffer into the editor contents, which fails with the following error:

TypeError: Cannot convert value "[object Uint8Array]" to type gchararray
    at GtkSourceBuffer.text (/home/sven/projects/_3rdparty/node-gtk/lib/bootstrap.js:194:21)
    at loadFile (/home/sven/projects/_3rdparty/node-gtk/examples/editor.js:83:21)
    at Object.<anonymous> (/home/sven/projects/_3rdparty/node-gtk/examples/editor.js:213:1)
    at Module._compile (node:internal/modules/cjs/loader:1155:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1209:10)
    at Module.load (node:internal/modules/cjs/loader:1033:32)
    at Function.Module._load (node:internal/modules/cjs/loader:868:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
    at node:internal/main/run_main_module:22:47

Seems that the editor contents are actually expected to be a string, so this decodes it as a (UTF8) string instead. Quick test seemed to work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant