You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I had the same problem. Proc hello has to be of type HandlerAsync, which is proc(ctx: Context): Future[void] {.closure, gcsafe.}. hello is not GC-safe, because it accesses a global variable templates. At least that's what the compiler should say if you add .gcsafe pragma to the proc.
Uh oh!
There was an error while loading. Please reload this page.
I have problems with the handler. When I try to call some functions in the body of the handler, I get an error. How to deal with it?
My code:
My console log:
d:\nim-2.0.0\projects\fastcms\src\plugins\main page\main_page.nim(32, 6) Error: type mismatch
Expression: get(app, "/", hello)
[1] app: Prologue
[2] "/": string
[3] hello: proc (ctx: Context): Future[system.void]
Expected one of (first mismatch at [position]):
[1] func get(env: Env; key: string): string
[1] proc get(group: Group; route: string; handler: HandlerAsync; name = "";
middlewares: openArray[HandlerAsync] = @[])
[1] proc get[T](self: Option[T]): lent T
[1] proc get[T](self: Option[T]; otherwise: T): T
[1] proc get[T](self: var Option[T]): var T
[3] proc get(app: Prologue; route: string; handler: HandlerAsync; name = "";
middlewares: openArray[HandlerAsync] = @[])
The text was updated successfully, but these errors were encountered: