-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Module fedaration with shared libs and building #6923
Comments
I have faced the same issue, the problem is when the libs are buildable as far as I know, if the libs are not buildable like the example provided by @Coly010 in. the nrwl web it does not happen. If you need a repository to reproduce it let me know! |
@gerardcastell You're absolutely right, it is related to buildable libs and that's because buildable libs require a new This new It's straightforward enough to swap the path of the correct We have a plan for a solution and we're working on it! |
We will cut a release soon that includes the fix to this issue. To manually fix the current broken
const tsConfigPath =
process.env.NX_TSCONFIG_PATH ??
path.join(__dirname, '../../tsconfig.base.json');
const workspaceRootPath = path.join(__dirname, '../../');
sharedMappings.register(path.join(__dirname, '../../tsconfig.base.json'), [
'@nx-microfrontends/shared',
]); and replace it with: sharedMappings.register(
tsConfigPath,
['@nx-microfrontends/shared'],
workspaceRootPath
); N.B. This fix will not work until the next version of Nx is released. |
Nx 12.10.0 has been released and it includes this fix. If you upgrade and follow the steps above, you should be good to go! |
@Coly010
I logged the result of
I believe the problem sits in that the value in the |
@Coly010 even with your fix above... it's still happening for me with buildable libs - or exposing a module from a buildable lib.
Shared lib which is buildable (@my-org/a-buildable-child-lib)
Structure looks like:
If you add all the libs as shared libs then you get a similar error but on app level
Exposed Module from a buildable lib
|
It downloaded |
This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context. |
I am currently facing an error when building my mfe host and remote setup with sharing of libraries. I have tried swapping out the builder to use the "ngx-build-plus:browser", which seems to work. Serving both host and remote seems to work.
Current Behavior
When building a mfe host or remote with sharing of libs, it fails
Expected Behavior
The mfe host and remote can build using the nrwl angular builders
Steps to Reproduce
https://github.com/Geoffrey0/nx-microfrontends
Failure Logs
./libs/shared/src/index.ts - Error: Module build failed (from ./node_modules/@ngtools/webpack/src/ivy/index.js):
Error: .../nx-microfrontends/libs/shared/src/index.ts is missing from the TypeScript compilation. Please make sure it is in your tsconfig via the 'files' or 'include' property.
at .../nx-microfrontends/node_modules/@ngtools/webpack/src/ivy/loader.js:59:26
Environment
Node : 14.17.5
OS : darwin x64
npm : 6.14.14
nx : Not Found
@nrwl/angular : 12.8.0
@nrwl/cli : 12.8.0
@nrwl/cypress : 12.8.0
@nrwl/devkit : 12.8.0
@nrwl/eslint-plugin-nx : 12.8.0
@nrwl/express : Not Found
@nrwl/jest : 12.8.0
@nrwl/linter : 12.8.0
@nrwl/nest : Not Found
@nrwl/next : Not Found
@nrwl/node : Not Found
@nrwl/nx-cloud : Not Found
@nrwl/react : Not Found
@nrwl/schematics : Not Found
@nrwl/tao : 12.8.0
@nrwl/web : Not Found
@nrwl/workspace : 12.8.0
@nrwl/storybook : 12.8.0
@nrwl/gatsby : Not Found
typescript : 4.3.5
The text was updated successfully, but these errors were encountered: