From 53feaea1f0b4567602940261a8f5187749d82854 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?W=C3=A9sley=20Guimar=C3=A3es?= Date: Tue, 17 Feb 2026 16:33:16 -0300 Subject: [PATCH 1/2] remove {.global.} global is breaking in latest nim versions, removing it solved the problem for me. I'm a newbie in nim/webview development, but I think this shouldn't be much trouble to remove from what I tested. --- webview.nim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webview.nim b/webview.nim index b6eb93a..2fdf0d0 100644 --- a/webview.nim +++ b/webview.nim @@ -412,7 +412,7 @@ proc bindCallback*(w: Webview; name: string; # using global seems to work... # TODO is there a better solution? - let arg {.global.} = CallBackContext(w: w, fn: fn) + let arg = CallBackContext(w: w, fn: fn) result = w.webviewBind(name, closure, cast[pointer](arg)) From 3dde4625e7c8405992417713fd385d2037523db7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?W=C3=A9sley=20Guimar=C3=A3es?= Date: Sat, 28 Feb 2026 15:45:26 -0300 Subject: [PATCH 2/2] Update webview.nim Removing global comment as it is out of context by removing the global pragma --- webview.nim | 3 --- 1 file changed, 3 deletions(-) diff --git a/webview.nim b/webview.nim index 2fdf0d0..0e03670 100644 --- a/webview.nim +++ b/webview.nim @@ -409,9 +409,6 @@ proc bindCallback*(w: Webview; name: string; fn: proc (id: string; req: JsonNode): string): WebviewError {.discardable.} = ## Essentially a high-level version of ## `webviewBind <#webviewBind,Webview,cstring,proc(cstring,cstring,pointer),pointer>`_ - - # using global seems to work... - # TODO is there a better solution? let arg = CallBackContext(w: w, fn: fn) result = w.webviewBind(name, closure, cast[pointer](arg))