Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Runtime error with Webpack Module Federation because of old "clsx" dependency #5483

Closed
tgelu opened this issue Nov 28, 2023 · 0 comments · Fixed by #5487
Closed

Runtime error with Webpack Module Federation because of old "clsx" dependency #5483

tgelu opened this issue Nov 28, 2023 · 0 comments · Fixed by #5487

Comments

@tgelu
Copy link

tgelu commented Nov 28, 2023

Provide a general summary of the issue here

Some react-aria packages depend on clsx@^1.1.1. This dependency has esm support issues. This is not a major issue normally, but with Webpack's Module Federation plugin it becomes a blocker because of a runtime error.

TypeError: (0, clsx__WEBPACK_IMPORTED_MODULE_1__) is not a function

🤔 Expected Behavior?

react-aria packages should work with Webpack Module Federation plugin.

😯 Current Behavior

Cannot use react-aria packages in apps built with Webpack Module Federation plugin. At runtime the clsx module is not consumed properly:

TypeError: (0, clsx__WEBPACK_IMPORTED_MODULE_1__) is not a function

💁 Possible Solution

This issue has been fixed at clsx@2.0.0. I tested that it does fix the runtime issue mentioned.

🔦 Context

I am using react-aria packages in a micro frontend environment with Webpack Module Federation plugin.

🖥️ Steps to Reproduce

module federation + a react-aria package that depends on clsx

Version

latest react-aria packages versions

What browsers are you seeing the problem on?

Firefox, Chrome, Safari, Microsoft Edge, Other

If other, please specify.

No response

What operating system are you using?

OSX

🧢 Your Company/Team

No response

🕷 Tracking Issue

No response

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 a pull request may close this issue.

1 participant