Skip to content

Comments

fix: Fix package.json types with typesVersions#150

Merged
gabivlj merged 1 commit intocloudflare:mainfrom
NuroDev:fix/package-types
Feb 5, 2026
Merged

fix: Fix package.json types with typesVersions#150
gabivlj merged 1 commit intocloudflare:mainfrom
NuroDev:fix/package-types

Conversation

@NuroDev
Copy link
Member

@NuroDev NuroDev commented Feb 5, 2026

Summary

This change updates the package.json to add a missing typesVersions which is needed to properly tell TypeScript and npm where our TypeScript types are located.

Why?

Currently we're relying on exports.*.types to map the types. But support for this is still quite flakey from the looks of it. If you install the package right now (0.1.0) npm will not show the TypeScript badge next to the package, indicating that it cannot resolve the types for it. Similarly, if you simply try to use the package you will get this type error:

import { Container } from "@cloudflare/containers";
                           // ^? Cannot find module '@cloudflare/containers' or its corresponding type declarations.

Adding typesVersions fixes this as this is technically the legacy method to map / bind types. Either that or switching back to using the original standard of main, module and types properties.

@NuroDev NuroDev requested a review from a team as a code owner February 5, 2026 11:42
@pkg-pr-new
Copy link

pkg-pr-new bot commented Feb 5, 2026

Open in StackBlitz

npm i https://pkg.pr.new/cloudflare/containers/@cloudflare/containers@150

commit: 6f998c8

@gabivlj gabivlj merged commit 8358156 into cloudflare:main Feb 5, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants