cloudflare:test is not resolved when using @cloudflare/vitest-pool-workers in compilerOptions.types
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 70/100
- Issue type
- Documentation
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- typescript
- Domain
- documentation
Research direction
Review the two linked Vitest integration pages, especially the compilerOptions.types examples and the sections that import from cloudflare:test. Verify the documented setup against @cloudflare/vitest-pool-workers 0.14.7 and confirm which types entry resolves the module. Done means the documentation accurately describes the required entry or package-version distinction.
Written by the indexing model from the issue text.
Description
Example URL(s)
- https://developers.cloudflare.com/workers/testing/vitest-integration/write-your-first-test/
- https://developers.cloudflare.com/workers/testing/vitest-integration/test-apis/
Actual Behavior
Following the docs, I added @cloudflare/vitest-pool-workers to compilerOptions.types and wrote a test importing from cloudflare:test.
TypeScript still reported:
Cannot find module 'cloudflare:test' or its corresponding type declarations.
In my setup, cloudflare:test only resolved after I changed the types entry from:
"types": ["@cloudflare/vitest-pool-workers"]
to:
"types": ["@cloudflare/vitest-pool-workers/types"]
Expected Behavior
Using @cloudflare/vitest-pool-workers in compilerOptions.types should make cloudflare:test resolvable, as described in the docs.
If @cloudflare/vitest-pool-workers/types is actually required for some package versions, the docs should say that explicitly.
Additional information
Environment:
- @cloudflare/vitest-pool-workers: 0.14.7
- vitest: 4.1.4
- wrangler: 4.21.2
- typescript: 5.8.3
- vite: 6.4.2
- @cloudflare/workers-types: 4.20260418.1
From inspecting the installed package, it looks like:
- the root package type entry points to the main plugin/config typings
- the ambient declare module "cloudflare:test" declaration is exposed via the ./types subpath
That appears to be why @cloudflare/vitest-pool-workers/types works while @cloudflare/vitest-pool-workers does not.
- Dominant language
- MDX
- Stars
- 5.2k
- Forks
- 16.8k
- Avg merge
- 2d 13h
- Merged PRs (30d)
- 344
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 cloudflare/cloudflare-docs
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
cloudflare/cloudflare-docs#33517 ·
-
content:edit documentation product:cloudflare-one
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
cloudflare/cloudflare-docs#33311 · 1 comment ·
-
content:edit documentation product:email-service
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
cloudflare/cloudflare-docs#33252 · 1 comment ·
-
content:new documentation product:workers
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
cloudflare/cloudflare-docs#32869 · 6 comments ·
-
content:edit documentation product:artifacts
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
cloudflare/cloudflare-docs#32812 · 1 comment ·
All issues in cloudflare/cloudflare-docs
Similar issues
-
user-reported
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Kong/developer.konghq.com#7316 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
HarperFast/skills#96 ·
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
infinispan/infinispan#18150 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 78/100
fullcalendar/fullcalendar#8106 ·