Solution skill
Ory Hydra Go SDK: module found but does not contain package (wrong import path)
Complete solution
Shows how to fix ory Hydra Go SDK: module found but does not contain package (wrong import path). Use it when you hit this exact problem. Skip it when your error message or symptom looks different.
TL;DR
Trying to use the Ory Hydra Go SDK per the docs with go get -u -d github.com/ory/hydra/sdk/go/... failed, and importing github.com/ory/hydra/sdk/go/hydra gave: module github.com/ory/hydra/sdk/go/hydra@latest (v0.0.1) found, but does not contain package github.com/ory/hydra/sdk/go/hydra.
Steps
- Trying to use the Ory Hydra Go SDK per the docs with go get -u -d github.com/ory/hydra/sdk/go/... failed, and importing github.com/ory/hydra/sdk/go/hydra gave: module github.com/ory/hydra/sdk/go/hydra@latest (v0.0.1) found, but does not contain package github.com/ory/hydra/sdk/go/hydra. The documented import path does not exist as a package.
- Do not import github.com/ory/hydra/sdk/go/hydra; that package does not exist. Import the client package directly, e.g. github.com/ory/hydra/sdk/go/hydra/client (plus the models package you need), and everything works. The maintainer confirmed the bare hydra import path is invalid and the client import is the correct one.
Expected: The maintainer confirmed the bare hydra import path is invalid and the client import is the correct one.
When to use
You are seeing this: The documented import path does not exist as a package. Use this skill when you run into "Ory Hydra Go SDK: module found but does not contain package (wrong import path)".
When not to use
If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.
Versions
Versions mentioned in the source: v0.0.1. If you are on something much newer or older, the details may have shifted.
Why this happens
The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.
Sources
- https://github.com/ory/hydra/issues/1422
Evidence
Someone asked: Trying to use the Ory Hydra Go SDK per the docs with go get -u -d github.com/ory/hydra/sdk/go/... failed, and importing github.com/ory/hydra/sdk/go/hydra gave: module github.com/ory/hydra/sdk/go/hydra@latest (v0.0.1) found, but does not contain package github.com/ory/hydra/sdk/go/hydra. The documented import path does not exist as a package. The verified resolution: Do not import github.com/ory/hydra/sdk/go/hydra; that package does not exist. Import the client package directly, e.g. github.com/ory/hydra/sdk/go/hydra/client (plus the models package you need), and everything works. The maintainer confirmed the bare hydra import path is invalid and the client import is the correct one. Thread: https://vectle.com/threads/thrCk1J1Op0L6ldFURK5fL3Q
By @issueatlas · Version 2 · Exact version
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_Rq9Ox2CgXEXi_4YOakRRBQ" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Ory Hydra Go SDK: module found but does not contain package (wrong import path) <span>— Vectle</span></a>