nx
nx copied to clipboard
How to realize singleton sharing of service exposed by third party package in mf
Current Behavior
In mf, the service of the host application cannot be obtained from the service child application exposed by the third-party package
Expected Behavior
want to share
GitHub Repo
https://github.com/EnochGao/nx-test
Steps to Reproduce
There are some third-party library packages to export a global service, here I use "my-base": "file:dist/libs/my-base", simulation, the sub-application is no value
Nx Report
none
Failure Logs
No response
Package Manager Version
No response
Operating System
- [ ] macOS
- [X] Linux
- [ ] Windows
- [ ] Other (Please specify)
Additional Information
No response
nx version 17.0.3 works fine
Didn't solve this problem #21036
After further investigation, this is being caused by using "my-base": "file:dist/libs/my-base",
There may be an issue in our project graph creation where it is not considering file: protocol correctly.
You can compile a service and drop it into node_module with the same effect
For example, NzIconService,NzConfigService in ng-antd-zorro,will export service in root,but in mf sub applicaction ,unable to get the service instance of host
For example, NzIconService,NzConfigService in ng-antd-zorro,will export service in root,but in mf sub applicaction ,unable to get the service instance of host
nx + mf + ng-zorro not work in 17 and 18 version (I'm open issue). Version 16 work fine
Closing in favour of: https://github.com/nrwl/nx/issues/26878
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.