Skip to content

Go 1.24 compatibility: internal error: package "encoding/json" without types was imported from "github.com/a-h/respond" #32

@hosseio

Description

@hosseio

I run into this problem generating the spec in an endpoint working with Fiber. Then I realized that same problem occurs when running the chi example:
internal error: package "encoding/json" without types was imported from "github.com/a-h/respond".

It seems usually these problems are environmental and involve stale cached packages, but cleaning the mod cache wasn't good enough.

In case this helps:

$ go version
go version go1.24.1 darwin/arm64
$uname -a
Darwin machinename.local 24.1.0 Darwin Kernel Version 24.1.0: Thu Nov 14 18:19:02 PST 2024; root:xnu-11215.41.3~13/RELEASE_ARM64_T8132 arm64

edit: just cloned it and tests fail because of the same reason:

=== RUN   TestSchema
=== RUN   TestSchema/test000.yaml
--- PASS: TestSchema/test000.yaml (0.00s)
=== RUN   TestSchema/test001.yaml
2025/03/28 12:55:44 internal error: package "net/http" without types was imported from "github.com/a-h/rest"

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