react-spectrum: react-aria/i18n circular dependency

🐛 Bug Report

We use react-aria extensively in our project, and when we upgraded to react-aria 3.19.0, a new warning appeared regarding the circular dependency between react-aria/i18n/dist/module.js and react-aria/i18n/dist/useMessageFormatter.module.js.

Upgrading to 3.20.0 didn’t solve the issue.

We couldn’t find any mention of this issue here, and also couldn’t find the culprit on our end, so we decided to raise it.

If you think it’s a problem on our end, we’d be happy to receive any pointers on what to look into.

🤔 Expected Behavior

No circular dependencies present.

😯 Current Behavior

A warning is shown about the circular dependency in react-aria/i18n when we’re building our package:

[...]

$ yarn build
yarn run v1.22.19
$ rollup -c

src/index.ts → dist/index.cjs.js, dist/index.esm.js...
(!) Circular dependency
node_modules/@react-aria/i18n/dist/module.js -> node_modules/@react-aria/i18n/dist/useMessageFormatter.module.js -> node_modules/@react-aria/i18n/dist/module.js

[...]

🌍 Your Environment

Software Version(s)
react-aria 3.19.0 - 3.20.0
react 17.0.2
typescript 4.7.4
nodejs 18.9.0

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 1
  • Comments: 20 (16 by maintainers)

Most upvoted comments

@snowystinger it seems like an issue exists still exists. Would be great to update this line https://github.com/adobe/react-spectrum/blob/main/packages/%40react-aria/i18n/src/useMessageFormatter.ts#L15 to import from context as per your suggestion. Even though the useMessageFormatter is deprecated there is no documentation about alternative function. Plus it requires some extra work to migrate to it.

Hey, thanks for the issue. We haven’t seen this one yet. I’m looking through those packages on our end, but I’m not seeing anything indicating we have a circular dependency. Would you be willing to look in node_modules and see what the actual circle is? (what from each file is depending on the other)