You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, in the past few days I tried to use the plugin inside my app which is part of an NX monorepo.
Unfortunately I got 404 when trying to fetch ..../monorepo/node_modules/__mf__virtual/remote_app_H_A_I_hostAutoInit_H_A_I.js (I cant remember the exact name but it was close to that).
Fiddling around, I realized that because this is an NX monorepo, and the node_modules are located under the whole monorepo and not under the app (where it usually would be), vite doesn't expose it.
I tried some workarounds, and what I found to be working is adding to the vite's config: build: { fs: { allow: ['..../monorepo/node_modules'] } }
My takeaway from this journey is that it either should be solved Inside the plugin itself, or if thats beyond the capabilities, at least add this bit of information to the docs.
Would like to hear what you think about it
P.S this app is pretty big with quite a few dependecies (one of the currently is @originjs/vite-plugin-federation) and we've never had this kind of problem
The text was updated successfully, but these errors were encountered:
@DanielSegal1 thanks for your investigation.
We definitely need to add a note in the readme file. I prefer to inform the end user rather than try to cover all the possible configurations. Your case is Nx, but another one is Turborepo, etc. etc.
Can I ask you to open a PR for that? Thanks
Hi, in the past few days I tried to use the plugin inside my app which is part of an NX monorepo.
Unfortunately I got 404 when trying to fetch ..../monorepo/node_modules/__mf__virtual/remote_app_H_A_I_hostAutoInit_H_A_I.js (I cant remember the exact name but it was close to that).
Fiddling around, I realized that because this is an NX monorepo, and the node_modules are located under the whole monorepo and not under the app (where it usually would be), vite doesn't expose it.
I tried some workarounds, and what I found to be working is adding to the vite's config:
build: { fs: { allow: ['..../monorepo/node_modules'] } }
My takeaway from this journey is that it either should be solved Inside the plugin itself, or if thats beyond the capabilities, at least add this bit of information to the docs.
Would like to hear what you think about it
P.S this app is pretty big with quite a few dependecies (one of the currently is @originjs/vite-plugin-federation) and we've never had this kind of problem
The text was updated successfully, but these errors were encountered: