Skip to content

[Bug] {nimble pkg dir}/jsony.nim(739, 15) Error: attempting to call undeclared routine: 'toJson' #88

Description

@Luyten-Orion

Heya, I'm currently working on a project and decided to use jsony, but it seems that there's an issue with toJson as shown with this error:
/home/runner/.nimble/pkgs2/jsony-1.1.5-6aeb83e7481ca8686396a568096054bc668294df/jsony.nim(739, 15) Error: attempting to call undeclared routine: 'toJson'

I'm unable to make a minimal reproducible example despite my efforts, so I simply added a step to my workflow to demonstrate the issue: https://github.com/Luyten-Orion/Supernovae/actions/runs/9423485799/job/25961966047#step:4:82

The code that causes the issue seems to be here, but I'll also post the snippet for convenience: https://github.com/Luyten-Orion/Supernovae/blob/main/src/supernovae/api.nim#L11-L12

template respond[T](request: Request, code: int, headers: HttpHeaders, body: T) =
  request.respond(code, headers, toJson[T](body))

In a minute I'll create a PR to add the necessary forward declare to alleviate the issue.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions