Broken TypeScript sample in your homepage hero snippets
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 68/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- typescript
- Domain
- documentation
Research direction
Start with the homepage hero partials and inspect both the standard and realtime TypeScript snippets against @directus/sdk@25.0.1. Verify the examples compile after composing the clients as described, then run the existing checker or TypeScript validation; done means both snippets compile without the reported client errors.
Written by the indexing model from the issue text.
Description
I ran a checker over your docs and 2 of the TypeScript samples don't compile
against @directus/sdk@25.0.1 (found via the homepage hero partials, reused
elsewhere). Example:
import { createDirectus, rest, readItems } from '@directus/sdk';
const directus = createDirectus('http://directus.example.com');
const item = await directus.request(
readItems('articles', { fields: ['id', 'title'] })
);
// TS error: Property 'request' does not exist on type 'DirectusClient<any>'.
The snippet imports rest but never calls .with(rest()) — the bare client
from createDirectus() doesn't have .request() until you compose it in.
Same issue on the realtime hero snippet: it calls .setToken() without
.with(authentication()).
Separately: docs.directus.io/llms-full.txt currently redirects to a dead
Vercel preview URL (404) — probably unrelated, but worth a look.
I think it's drift between the published package and the docs rather than a
mistake in the sample.
I'm building a small CLI that catches this in CI. Two questions if you have a
minute: does this kind of thing get reported to you by users, and is it
something anyone currently owns?
Happy to share the full JSON report if that's useful — just ask.
David
- Dominant language
- TypeScript
- Stars
- 22
- Forks
- 82
- Avg merge
- 18h 49m
- Merged PRs (30d)
- 4
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from directus/docs
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
Difficulty 2/5 Half a day Newbie friendliness 78/100
-
content-missing
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
copse-dev/agent-pane#2953 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Eynzof/Hermes-CN-Desktop#610 ·
-
bug clawsweeper:linked-pr-open clawsweeper:needs-live-repro clawsweeper:no-new-fix-pr impact:message-loss issue-rating: 🐚 platinum hermit P2 regression
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
calcite-components needs triage refactor
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Esri/calcite-design-system#15203 ·