Skip to content

@astrojs/cloudflare dependency on deprecated @cloudflare/workers-types breaks Env typing in monorepos #14481

Description

@calumpeak

Astro Info

Astro                    v5.3.0
Node                     v24.7.0
System                   macOS (arm64)
Package Manager          npm
Output                   server
Adapter                  @astrojs/cloudflare
Integrations             @clerk/astro/integration
                         @astrojs/starlight
                         @astrojs/react
                         @astrojs/mdx

If this issue only occurs in one browser, which browser is a problem?

No response

Describe the Bug

When running a monorepo with other cloudflare wrangler (v4) applications, if a package installs the deprecated @cloudflare/workers-types package (if the other packages have migrated off it and use wrangler types), it breaks the typing for the other applications by Env being unable to resolve causing type errors through the other applications.

Package a -> installs wrangler -> wrangler types -> outputs worker-configuration.d.ts -> all Env typing is correct
Package b -> installs @astrojs/cloudflare (dependency on @cloudflare/workers-types) -> installs dependencies -> Pakage a's typing is broken for Env (Env = any)

Note: the reproduction will need to be pulled down locally and npx wrangler types run in packages/app to view issue. Remove astrojs/cloudflare from the docs package and notice how the type errors dissapear in the app package.

What's the expected result?

@astrojs/cloudflare should not have a deprecated package in its dependencies which can break typing for other packages and overwrite typing.

Link to Minimal Reproducible Example

https://stackblitz.com/edit/sb1-61xgrc2f?file=packages%2Fapp%2Fwrangler.toml

Participation

  • I am willing to submit a pull request for this issue.

Metadata

Metadata

Labels

- P3: minor bugAn edge case that only affects very specific usage (priority)triage: needs triageIssue needs to be triaged

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions