module-federation / fmr Goto Github PK
View Code? Open in Web Editor NEWFederated Module Reloading for DEV mode
License: ISC License
Federated Module Reloading for DEV mode
License: ISC License
I've read this article about alpha version of FMR plugin, dated August 2021
https://medium.com/@A__G__B/introducing-fmr-federated-module-reloading-820ec56256db
Please let us know about the current status of the project, whether it needs maintainers or it is superseded by other tool, buil-in to webpack?
I get an error when I try to add MFLiveReloadPlugin to vue.config.js.
Maybe it's a babel problem, but I can't find the exact cause.
Help. I've been up all night for a few days...
Step 1. add Dependency
Step 2. add vue.config.js MFLiveReloadPlugin
Step 3. yarn build or yarn serve ..
ERROR SyntaxError: Unexpected token '?'
/Users/god/dev/pilot/web/mono-vue3-module-federation/components/comm-components/node_modules/@module-federation/fmr/src/server/sockets/modules/useSocketMessage.js:36
data: data ?? undefined,
^
SyntaxError: Unexpected token '?'
at wrapSafe (internal/modules/cjs/loader.js:931:16)
at Module._compile (internal/modules/cjs/loader.js:979:27)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1035:10)
at Module.load (internal/modules/cjs/loader.js:879:32)
at Function.Module._load (internal/modules/cjs/loader.js:724:14)
at Module.require (internal/modules/cjs/loader.js:903:19)
at require (internal/modules/cjs/helpers.js:74:18)
at Object.<anonymous> (/Users/god/dev/pilot/web/mono-vue3-module-federation/components/comm-components/node_modules/@module-federation/fmr/src/server/sockets/handlers/index.js:4:30)
at Module._compile (internal/modules/cjs/loader.js:1015:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1035:10)
I tried to configure fmr on node version > 14 it is working fine
but i want to make it work on node version 12 but webpack is not getting complied
/node_modules/@module-federation/fmr/src/server/sockets/modules/useSocketMessage.js:36
data: data ?? undefined,
^
SyntaxError: Unexpected token '?'
at new Script (vm.js:88:7)
at NativeCompileCache._moduleCompile (/Users/chetanverma/phable/phable.doctor.frontend.rx/ams-appointment/node_modules/v8-compile-cache/v8-compile-cache.js:240:18)
at Module._compile (/Users/chetanverma/phable/phable.doctor.frontend.rx/ams-appointment/node_modules/v8-compile-cache/v8-compile-cache.js:184:36)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
at Module.load (internal/modules/cjs/loader.js:863:32)
at Function.Module._load (internal/modules/cjs/loader.js:708:14)
at Module.require (internal/modules/cjs/loader.js:887:19)
at require (/Users/chetanverma/phable/phable.doctor.frontend.rx/ams-appointment/node_modules/v8-compile-cache/v8-compile-cache.js:159:20)
at Object.<anonymous> (/Users/chetanverma/phable/phable.doctor.frontend.rx/ams-appointment/node_modules/@module-federation/fmr/src/server/sockets/handlers/index.js:4:30)
at Module._compile (/Users/chetanverma/phable/phable.doctor.frontend.rx/ams-appointment/node_modules/v8-compile-cache/v8-compile-cache.js:192:30)
Some code contains es2020 , which is not support by node 12
I tried things but not able resolve it , if you guys know how i can do that it will be great help @ScriptedAlchemy
hi, Testing this library i found problems with mini-css-extract-plugin, is there a way to solve this ?
ERROR in ./src/assets/index.scss
Module build failed (from ./node_modules/mini-css-extract-plugin/dist/loader.js):
HookWebpackError: window is not defined
at tryRunOrWebpackError (/home/carlos/htdocs/plitzi-sdk/node_modules/webpack/lib/HookWebpackError.js:88:9)
at __webpack_require_module__ (/home/carlos/htdocs/plitzi-sdk/node_modules/webpack/lib/Compilation.js:4979:12)
at /home/carlos/htdocs/plitzi-sdk/node_modules/webpack/lib/Compilation.js:5003:11
at symbolIterator (/home/carlos/htdocs/plitzi-sdk/node_modules/neo-async/async.js:3485:9)
at timesSync (/home/carlos/htdocs/plitzi-sdk/node_modules/neo-async/async.js:2297:7)
at Object.eachLimit (/home/carlos/htdocs/plitzi-sdk/node_modules/neo-async/async.js:3463:5)
at /home/carlos/htdocs/plitzi-sdk/node_modules/webpack/lib/Compilation.js:4879:16
at symbolIterator (/home/carlos/htdocs/plitzi-sdk/node_modules/neo-async/async.js:3485:9)
at done (/home/carlos/htdocs/plitzi-sdk/node_modules/neo-async/async.js:3527:9)
at /home/carlos/htdocs/plitzi-sdk/node_modules/webpack/lib/Compilation.js:4794:8
-- inner error --
ReferenceError: window is not defined
at webpack/runtime/live reloading runtime module:2:1
at /home/carlos/htdocs/plitzi-sdk/node_modules/webpack/lib/javascript/JavascriptModulesPlugin.js:460:11
at Hook.eval [as call] (eval at create (/home/carlos/htdocs/plitzi-sdk/node_modules/webpack/node_modules/tapable/lib/HookCodeFactory.js:19:10), <anonymous>:9:1)
at /home/carlos/htdocs/plitzi-sdk/node_modules/webpack/lib/Compilation.js:4981:39
at tryRunOrWebpackError (/home/carlos/htdocs/plitzi-sdk/node_modules/webpack/lib/HookWebpackError.js:83:7)
at __webpack_require_module__ (/home/carlos/htdocs/plitzi-sdk/node_modules/webpack/lib/Compilation.js:4979:12)
at /home/carlos/htdocs/plitzi-sdk/node_modules/webpack/lib/Compilation.js:5003:11
at symbolIterator (/home/carlos/htdocs/plitzi-sdk/node_modules/neo-async/async.js:3485:9)
at timesSync (/home/carlos/htdocs/plitzi-sdk/node_modules/neo-async/async.js:2297:7)
at Object.eachLimit (/home/carlos/htdocs/plitzi-sdk/node_modules/neo-async/async.js:3463:5)
Generated code for webpack/runtime/live reloading runtime module
1 |
2 | if(!window.liveReload) {
3 | window.liveReload = true
4 | const socket = new WebSocket('ws://localhost:40001');
5 | socket.addEventListener('open', function (event) {
6 | console.log(`Client opened connection to server.`);
7 | });
8 |
9 | socket.addEventListener('message', function (event) {
10 | var message = JSON.parse(event.data);
11 | if (message.type === 'reload') {
12 | console.log('Reloading page due to reload event...');
13 | window.location.reload();
14 | }
15 | });
16 | socket.addEventListener('close', (event) => {
17 | console.log('Closing socket');
18 | socket.close();
19 | });
20 |
21 | }
22 |
@ ./src/App.js 25:0-29
@ ./WidgetEntryPointBootstrap.js 21:0-28 41:34-37 76:32-35
@ container entry ./Sdk[0]
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.