module-federation / fmr-issues Goto Github PK
View Code? Open in Web Editor NEWa place to file issues related to FMR plugin
a place to file issues related to FMR plugin
Hi, thanks for your work ๐
I use Lerna in a monorepo.
Some of my subpackages use webpack 4, some of my subpackages use webpack 5.
When Lerna installs (bootstraps) my subprojects it uses node module resolution to determine where to hoist packages depending on their dependencies.
Right now, the fmr package does not specify that it needs any particular webpack version to work, so gets hoisted up to v4 webpack sometimes.
This results in failure to compile and a stack trace like:
[webpack cli] TypeError: Class extends value undefined is not a constructor or null at Object.<anonymous> (node_modules/@module-federation/fmr/src/index.js:40:39)
The solution is to specify the correct webpack dependency as a "peerDependency" in your package.json
I have tested this and confirmed it works with
"peerDependencies": {
"webpack": "~5.39"
}
Hi,
I have some webpack configurations in typescript.
The fmr package does not have its own type definition at the moment and there is no community package via DefinitelyTyped.
This means Typescript will throw with cannot find a declaration file for module '@module federation/fmr'
.
On the consumer side this can be worked around by creating a local declaration file.
Will you create and maintain your own types or should we create the community version?
This is the stack trace when I see the error:
<e> [MFLiveReloadPlugin] TypeError: Cannot read property 'readyState' of undefined
<e> at MFLiveReloadPlugin._afterEmit (C:\source\.yarn\cache\@module-federation-fmr-npm-0.0.5-5047596128-d8648b1820.zip\node_modules\@module-federation\fmr\src\index.js:207:27)
<e> at C:\source\.yarn\cache\@module-federation-fmr-npm-0.0.5-5047596128-d8648b1820.zip\node_modules\@module-federation\fmr\src\index.js:171:12
<e> at Hook.eval [as callAsync] (eval at create (C:\source\.yarn\cache\tapable-npm-2.2.0-516ee6aa5b-5a7e31ddd2.zip\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:9:1)
<e> at C:\source\.yarn\__virtual__\webpack-virtual-6b0c007d3f\0\cache\webpack-npm-5.27.2-9c59c0498d-45ea8bd0b4.zip\node_modules\webpack\lib\Compiler.js:825:27
<e> at C:\source\.yarn\cache\neo-async-npm-2.6.2-75d6902586-deac9f8d00.zip\node_modules\neo-async\async.js:2818:7
<e> at done (C:\source\.yarn\cache\neo-async-npm-2.6.2-75d6902586-deac9f8d00.zip\node_modules\neo-async\async.js:3522:9)
<e> at writeOut (C:\source\.yarn\__virtual__\webpack-virtual-6b0c007d3f\0\cache\webpack-npm-5.27.2-9c59c0498d-45ea8bd0b4.zip\node_modules\webpack\lib\Compiler.js:786:16)
<e> at C:\source\.yarn\__virtual__\webpack-virtual-6b0c007d3f\0\cache\webpack-npm-5.27.2-9c59c0498d-45ea8bd0b4.zip\node_modules\webpack\lib\util\fs.js:227:5
<e> at Immediate._onImmediate (C:\source\.yarn\cache\memory-fs-npm-0.4.1-0a5f9b8954-6db6c8682e.zip\node_modules\memory-fs\lib\MemoryFileSystem.js:303:5)
<e> at processImmediate (internal/timers.js:461:21)
This happens maybe 30% of the time when I serve the Federated Module when I test it locally. The behavior ends up being that auto-reloading stops working, but manual reloading does still work. Restarting webpack, usually ends up fixing this.
My guess for why I might be seeing this is that tcpPortUsed.waitUntilUsed
never resolved it's Promise, and then _afterEmit
is called at some point.
If there is any other info I can help provide, please feel free to let me know, happy to help.
Would it be possible to add a README here, or modify the wiki here, and maybe update the README of the https://github.com/module-federation/fmr repo, so as to more easily communicate the nature of the project? ๐
I am not questioning the fact that this project is not open contribution, but just want to add some clarity and save others some time. My own path to here was windy:
This is a fantastic package and a great addition to the federated modules ecosystem
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.