-
Notifications
You must be signed in to change notification settings - Fork 1k
Description
Which Cloudflare product(s) does this pertain to?
Workers for Platforms
What versions & operating system are you using?
Wrangler 4.13.2, TypeScript 5.8.3, Node 22.14.0, macOS 15.3.2
Please provide a link to a minimal reproduction
No response
Describe the Bug
Hi,
I'm reaching out to clarify some aspects of integrating TypeScript into my project. Although I've been following the documentation, I found certain points to be unclear.
This page provides the following steps for proper integration:
- Update
wranglerto version 4 - Generate types via
wrangler types - Add
worker-configuration.d.tsintocompilerOptions.types
I've successfully incorporated these steps into my codebase. However, I have a few questions to ensure I understand correctly:
- Is the
@cloudflare/workers-typespackage no longer required due to the--include-runtimeflag being enabled by default inwrangler4? - If so, can it be removed from
tsconfig.jsonas well? The documentation mentions removing@cloudflare/workers-typesimports in Worker code, but it's unclear if this applies to configurations as well.
Assuming the answer to both questions is yes, I noticed that in the TypeScript template, worker-configuration.d.ts is included in the include rather than compilerOptions.types. I'm guessing this might be because the template is still using wrangler 3, which would also explain @cloudflare/workers-types being still present in compilerOptions.types.
Could you provide clarification on this? The answer I am most looking for is whether I should include worker-configuration.d.ts in compilerOptions.types or include when using wrangler 4.
Please provide any relevant error logs
No response
Metadata
Metadata
Assignees
Labels
Type
Projects
Status