-
Notifications
You must be signed in to change notification settings - Fork 9
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
v1.0.0: error in shared dependencies ending with "/" #40
Comments
I am not familiar with this feature, it can be added to the roadmap |
If there is a document, please send it to me. I seem to have missed the document and did not see the function of this feature. |
you can see that in official next-js MF examples |
Is there any update? |
@smelukov is it not fixed for you? I thought previous version had a fix. Can you try latest, please |
This feature will start to be developed recently |
Nope, on 1.0.0-alpha-51eeeb6 it still doesn't work. |
Still actual problem |
I've been too busy recently, so I'll prioritize it this weekend. |
@smelukov Before completion, you can manually specify the shared module
|
@zhangHongEn This looks like Rollup's EDIT: Actually I'm not sure changing this should matter since Rollup says https://rollupjs.org/faqs/#why-do-additional-imports-turn-up-in-my-entry-chunks-when-code-splitting
|
My external is a dynamic import, but it has been modified to synchronous import. I will provide an example this afternoon
…---- Replied Message ----
| From | Hiroshi ***@***.***> |
| Date | 08/26/2024 07:58 |
| To | module-federation/vite ***@***.***> |
| Cc | zhn ***@***.***>,
Mention ***@***.***> |
| Subject | Re: [module-federation/vite] v1.0.0: error in shared dependencies ending with "/" (Issue #40) |
vite modulePreload will bring "shared module" forward and execute it before init. I can't disable this behavior.
@zhangHongEn This looks like Rollup's output.hoistTransitiveImportshttps://rollupjs.org/configuration-options/#output-hoisttransitiveimports Can you try disabling it?
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Thank you for your help. Disabling hoistTransitiveImports has not taken effect
…---- Replied Message ----
| From | Hiroshi ***@***.***> |
| Date | 08/26/2024 07:58 |
| To | module-federation/vite ***@***.***> |
| Cc | zhn ***@***.***>,
Mention ***@***.***> |
| Subject | Re: [module-federation/vite] v1.0.0: error in shared dependencies ending with "/" (Issue #40) |
vite modulePreload will bring "shared module" forward and execute it before init. I can't disable this behavior.
@zhangHongEn This looks like Rollup's output.hoistTransitiveImportshttps://rollupjs.org/configuration-options/#output-hoisttransitiveimports Can you try disabling it?
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
@zhangHongEn Thanks for the reproduction. I'm not sure if this is technically a bug of Vite. It looks like this is a issue/limitation of In your reproduction, you can mitigate the issue of manualChunks(id) {
...
// force a dedicated chunk for `__vitePreload` helper
// since Vite/Rollup doesn't guarantee which chunk this module gets merged into.
// https://github.com/vitejs/vite/blob/dbd6214f6fa5d35647cbd00580c76788ce894e9e/packages/vite/src/node/plugins/importAnalysisBuild.ts#L198-L208
if (id.includes('/preload-helper.js')) {
return "preload-helper"
}
} |
@hi-ogawa This works, I'll do it this way first, thanks for your help |
Closed by #67 |
@zhangHongEn the last update broke our project :( We have lerna monorepo with this structure:
|
@gioboa can we reopen the issue? |
Ok maybe it's incompatible with lerna monorepo, I'll fix it |
@zhangHongEn thanks! |
@smelukov @zhangHongEn @gioboa as we are moving forward it is important to make sure while fixing issues and adding new features we don't introduce regressions, as this is causing a lot of pain to end users. That was one of the reasons I tried to add examples with main features to make sure we can run them to see visually if anything affected. Moving forward will be great to add more examples like that, which could be our first line of defence, but also might be useful to think about integration and unit tests which could help to prevent as well. We might open a new ticket here to discuss ideas and suggestions for this. |
Yes, currently we rely entirely on examples to ensure quality, which is very important now. |
@smelukov I may know where there is a problem with the path setting, but I tried to use learn and failed to reproduce it. Can you provide more information and an example? |
@zhangHongEn here is an example https://github.com/smelukov/mf-vite-nx-bug npm i
npm start |
@smelukov Fixed, nx demo is running normally |
Thanks @zhangHongEn |
@zhangHongEn @gioboa our project is still broken :(
We do not have this error if we use the module federation plugin for webpack. Moreover, we use cssinjs and our project does not import any CSS files. PS: we use |
@smelukov can you create a new issue for this with a basic reproduction repository please? |
@gioboa This error is about a feature that was implemented for this issue. Should I create a new issue anyway? |
If I understand the problem correctly, now you have |
Some examples show using dependencies ending with
/
, but when I try the same here I get error:when
The text was updated successfully, but these errors were encountered: