Nextjs-mf Paid Package Support #978
Replies: 65 comments 142 replies
-
Hi, Thanks for all the work you've done on Module Federation, it's been very exciting to follow along with all the progress that has been made in recent months. I've been frustrated by the lack of options that NextJS provides for creating micro-frontends, and its great to see that Module Federation offers solutions for this. I've been playing around with the The repo is here: https://github.com/JohnDaly/nextjs-mf-issues, and it also has some videos that demonstrate the issue in the README. Thanks |
Beta Was this translation helpful? Give feedback.
-
I didn't see this dedicated space, so I started an issue here -> #1066 |
Beta Was this translation helpful? Give feedback.
-
Hello, Anyone has the following error when do refresh page in route /checkout from home app? Well, I'm getting the following error |
Beta Was this translation helpful? Give feedback.
-
I created a sample repo here: lednhatkhanh/next-mf-example to describe my problems, I don't know what I'm doing wrong here 😢. Currently, I have 2 problems with module federation:
If you have time, could you please help me check this, I have absolute no ideas about what I'm wrong here. |
Beta Was this translation helpful? Give feedback.
-
Sorry for the inconvenience, have you seen the following error after build (next builld) shell and microapp (checkout) and serve with start command, I'm getting an error any help? |
Beta Was this translation helpful? Give feedback.
-
Hello! Thank you for the work for the amazing library Btw, Is there a way I can use getServerSideProps instead of getInitialProps on the SSR page? (note)
It seems like I cannot use the getServerSideProps if I use the |
Beta Was this translation helpful? Give feedback.
-
Hello! love this library, thanks for your work on this! Would it be possible to add next/router to shared internals? I was able to get this working with my app by adding to the library code: to
to
another (very small) thing that would be nice- I had a typo in the file path in Thanks again! |
Beta Was this translation helpful? Give feedback.
-
How i can add publicRunTimeConfig or env vars in the MF? any ideas? Thanks |
Beta Was this translation helpful? Give feedback.
-
I'm trying to set up a NextJS shell application that includes an Apollo Client provider, which can be accessed via Apollo's data fetching hooks (e.g. The error that I'm seeing when I try and run the app is: The line that's causing the error is the Apollo Client import: This is the general set up (simplified for readability) is: _app.tsx import NextApp from 'next/app';
import { ApolloClient, ApolloProvider } from '@apollo/client';
const withApollo = (app) => {
const client = new ApolloClient(...);
return (
<ApolloProvider client={client}>
{app}
</ApolloProvider>
)
}
export default withApollo(NextApp); The module.exports = phase => ({
webpack(config, { isServer, webpack }) {
config.experiments = { topLevelAwait: true };
config.output.publicPath = 'auto';
if (isServer) {
// Ignore federated modules when doing SSR
Object.assign(config.resolve.alias, {
dashboard: false,
});
} else {
config.plugins.push(
new webpack.container.ModuleFederationPlugin({
remoteType: 'var',
remotes: {
dashboard: 'dashboard',
},
shared: {
// we have to share something to ensure share scope is initialized
'@module-federation/nextjs-mf/lib/noop': {
eager: false,
},
react: {
singleton: true,
eager: true,
requiredVersion: false,
},
'@apollo/client': {
singleton: true,
eager: true,
version: '3.3.19',
requiredVersion: '3.3.19',
},
},
}),
);
}
config.module.rules.push({
test: /_app.tsx/,
loader: '@module-federation/nextjs-mf/lib/federation-loader.js',
});
return config;
},
}); I assume this issue has something to do with the shared scope not getting initialized by the time the Apollo import is happening in |
Beta Was this translation helpful? Give feedback.
-
@ScriptedAlchemy Sorry to bother you again but I really need your help, you can checkout the problem here: lednhatkhanh/next-mf-example. The problem is, when I dynamically importing a json file and also expose it to another app:
Then when I navigate around the app using the Link component (You can click About link on the header), I will get this error. Reload the page and it will work again. This is only happening in development and working fine in production, must be something related to Next.js. |
Beta Was this translation helpful? Give feedback.
-
Hi there, I just purchased this and it looks awesome! I just have a question regarding server side rendering, I saw you mention in the README that it only supports client side rendering but I was wondering if there was any way to get this to work with SSR or any plan to support in the future please? If not would it be possible to have a quick explanation of why just for my understanding ;-) Thanks! |
Beta Was this translation helpful? Give feedback.
-
Is there a recommended approach for global CSS imports that are usually loaded into I have a few dependencies that require importing their CSS as in One option I consider is to overwrite the Thoughts? |
Beta Was this translation helpful? Give feedback.
-
I'm seeing an issue when trying to get a module that is both in the remote app and also exposed in the sidecar.
Starting the app creates However, in the original remote app, when running it independently, I see errors about missing chunks:
However, accessing If I remove the sidecar, the remote app starts working again. If I strip I understand this is very vague and can be a result of many things, but any pointers on what can cause this? |
Beta Was this translation helpful? Give feedback.
-
Hi, first of all thanks for all the work you have done on module federation. I purchased your @module-federation/nextjs-mf package and tried to get a simple example going. Sadly I could not manage to get it working properly. I pretty much followed all your instructions but the exposed component just wont show within the consumer app. Any idea where i went wrong? Your help is much appreciated. Best regards, Mike I reproduced my issue in this repo |
Beta Was this translation helpful? Give feedback.
-
Hot reloading issue: My exposed entry is Additionally: I noticed that we hook into |
Beta Was this translation helpful? Give feedback.
-
@ScriptedAlchemy Hello. |
Beta Was this translation helpful? Give feedback.
-
Does this module support production applications? |
Beta Was this translation helpful? Give feedback.
-
Hi, I'm following the example on the readme and I keep getting an error when trying to run the app, this is my next.config.js:
and this is the error I keep getting:
If I remove I'm using NextJS 11.0.1 Thanks in advance. |
Beta Was this translation helpful? Give feedback.
-
When there will be a free version of this package ? |
Beta Was this translation helpful? Give feedback.
-
Thanks :))
…On Wed, Oct 5, 2022 at 12:49 PM matthintosh ***@***.***> wrote:
Already released on npm...
—
Reply to this email directly, view it on GitHub
<#978 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AD6OV4OINIE45PRRVHHK5WDWBVMKDANCNFSM5A3VNP3A>
.
You are receiving this because you commented.Message ID:
<module-federation/module-federation-examples/repo-discussions/978/comments/3803902
@github.com>
|
Beta Was this translation helpful? Give feedback.
-
Guys, paid package for @module-federation/nextjs-mf |
Beta Was this translation helpful? Give feedback.
-
Please note nextjs-MF, on npm has feature parity with nextjs-ssr this means that Federation support on next is
GitHub sponsors are appreciated as I’ve lost my funding source by choosing to no longer charge money for these plugins |
Beta Was this translation helpful? Give feedback.
-
So it means that we can use nextjs-MF with ssr support or we need to use
only nextjs-SSR ?
…On Fri, Oct 7, 2022 at 9:15 AM Zack Jackson ***@***.***> wrote:
Please note nextjs-MF, on npm has feature parity with nextjs-ssr
this means that Federation support on next is
1. free
2. open source
3. supports SSR
GitHub sponsors are appreciated as I’ve lost my funding source by choosing
to no longer charge money for these plugins
—
Reply to this email directly, view it on GitHub
<#978 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AD6OV4MPZRIFSZGR3UXZ2DLWB7EYBANCNFSM5A3VNP3A>
.
You are receiving this because you commented.Message ID:
<module-federation/module-federation-examples/repo-discussions/978/comments/3820385
@github.com>
|
Beta Was this translation helpful? Give feedback.
-
But ssr is not working on Nextjs-mf, right ? Or I did something wrong?
…On Sat, 8 Oct 2022 at 09:42 Zack Jackson ***@***.***> wrote:
Just use nextjs MF. The SSR package is no longer needed or maintained.
—
Reply to this email directly, view it on GitHub
<#978 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AD6OV4M3G6CVDHCF6FXO453WCEQVJANCNFSM5A3VNP3A>
.
You are receiving this because you commented.Message ID:
<module-federation/module-federation-examples/repo-discussions/978/comments/3827723
@github.com>
|
Beta Was this translation helpful? Give feedback.
-
Hi. Thank you for all the super work on this! I understand this has now gone open source and is free however when I try to install it, |
Beta Was this translation helpful? Give feedback.
-
I am trying to use next-mf package in NX repo. Using the same config as implemented here: I am facing issue with this import: import '@module-federation/nextjs-mf/lib/include-defaults'; There is no lib folder in the published package, I am able to find this file in "src" folder, the path is getting resolved. Even then remote entry file is not fetched by the host. can you please confirm that this implementation is correct and there is no missing content in published package? |
Beta Was this translation helpful? Give feedback.
-
Hi @ScriptedAlchemy |
Beta Was this translation helpful? Give feedback.
-
Has any ever run into the issue where the remoteEntry.js file is generated locally under |
Beta Was this translation helpful? Give feedback.
-
next JS support for micro-frontend is clumsy and not working properly, weird error messages that does not hint about the actual problem. |
Beta Was this translation helpful? Give feedback.
-
I have navLinks.tsx in app directory (for nextjs 13 version) as below:"use client"; {categories.map((category) => ( ))} ); } export default NavLinks;And next.config.js as blow: /** @type {import('next').NextConfig} */ const nextConfig = { And i am getting error as below: error - ./app/NavLinks.tsx The "use client" directive must be placed before other expressions. Move it to the top of the file to resolve this issue. ,-[1:1] Do you have any example form client and server components interleaved (by use client) for module federation? |
Beta Was this translation helpful? Give feedback.
-
This software has been released as open source.
https://github.com/module-federation/universe/tree/main/packages/nextjs-mf
Please consider sponsoring me via GitHub sponsors as we are now totally dependent on sponsors to fund the development.
Next federation is extremely expensive to maintain. I've personally invested about $100,000 into its development.
Excluding the development hours I've spent- which comes to about $250,000 in dev hours.
If you can afford to, every dollar goes a very long way
Beta Was this translation helpful? Give feedback.
All reactions