Skip to content

react-aria-components/i18n imports undeclared @internationalized/string dependency #10194

@Stanzilla

Description

@Stanzilla

Provide a general summary of the issue here

react-aria-components/i18n imports @internationalized/string, but react-aria-components does not declare @internationalized/string as a direct dependency. This can fail under package managers/install layouts that do not make transitive dependencies available to packages that did not declare them.

I searched existing issues/PRs for @internationalized/string, react-aria-components i18n dependency pnpm, and LocalizedStringDictionary and did not find an existing report for this packaging issue.

🤔 Expected Behavior?

Importing react-aria-components/i18n should resolve all packages that react-aria-components imports internally from dependencies declared by react-aria-components.

😯 Current Behavior

With pnpm, importing the i18n entry can fail with:

Error: Cannot find package '@internationalized/string' imported from .../node_modules/react-aria-components/i18n/index.mjs
Did you mean to import "@internationalized/string/dist/index.cjs"?

The published package's i18n/index.mjs imports it directly:

import {LocalizedStringDictionary} from '@internationalized/string';

But react-aria-components@1.17.0 does not list @internationalized/string in dependencies. I also checked the current main package metadata through the GitHub API (packages/react-aria-components/package.json), and react-aria-components@1.18.0 still appears to omit it from dependencies.

💁 Possible Solution

Declare @internationalized/string as a dependency of react-aria-components.

The pnpm workaround is:

packageExtensions:
  react-aria-components@*:
    dependencies:
      "@internationalized/string": 3.2.8

🔦 Context

This came up while running tests in a pnpm monorepo using react-aria-components@1.17.0 transitively. pnpm why @internationalized/string showed the package present elsewhere in the graph via react-aria/react-stately, but it was not available to react-aria-components/i18n because react-aria-components itself did not declare it.

💻 Code Sample

A minimal repro should be any strict/isolated pnpm install that imports the i18n entry without hoisting transitive dependencies for undeclared imports:

import {LocalizedStringProvider} from 'react-aria-components/i18n';

🌍 Your Environment

Software Version
react-aria-components 1.17.0
pnpm 11.6.0
Node 25.9.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions