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

Critical dependency warning in @module-federation/utilities due to dynamic import #2794

Closed
5 tasks done
seshu-uggina opened this issue Jul 24, 2024 · 8 comments
Closed
5 tasks done

Comments

@seshu-uggina
Copy link

Describe the bug

I encountered a critical dependency warning related to a dynamic import while using the @module-federation/utilities package. This warning appears during the build process with Webpack.

WARNING in ../node_modules/@module-federation/utilities/dist/index.cjs.js 804:52-62
Critical dependency: the request of a dependency is an expression

Reproduction

Install @module-federation/utilities in your project. Configure Webpack to build the project. Run the build process. Observe the warning in the console output.

Used Package Manager

yarn

System Info

@module-federation/utilities version: 3.0.0 to 3.0.37

Validations

@krau5
Copy link

krau5 commented Jul 24, 2024

+1

@seshu-uggina
Copy link
Author

I have added tempaory fix in my appllication configuration to reslove this issue. here the code that i have added in my webpack configuration plugin section

new webpack.ContextReplacementPlugin(/@module-federation/utilities/, path.resolve(__dirname, 'node_modules/@module-federation/utilities/dist/index.cjs'),
{
// Provide context options if needed
},),

@ScriptedAlchemy
Copy link
Member

Dont use utilities, its dead, use the runtime package and loadRemote etc

@krau5
Copy link

krau5 commented Jul 28, 2024

@ScriptedAlchemy could it be a good idea to add some workaround/examples for loading the exact module via loadRemote? It seems, that documentation is not that clear for everyone.
I am using the module from the remote entry, which I am currently loading via importRemote. However, I have not figured out how to use the loadRemote for my case, and I have not found any examples on github as well.

@ScriptedAlchemy
Copy link
Member

the module federation website shows examples of the runtime.
Also dynamic remote or advanced api should as well in examples repo.

Copy link
Contributor

github-actions bot commented Oct 5, 2024

Stale issue message

@ScriptedAlchemy
Copy link
Member

This library has now been removed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants