Closed psrebrny closed 3 years ago
I have the same problem. I see that this problem is present when I add some lines in the angular.json - styles sections:
"styles": [ "./node_modules/@angular/material/prebuilt-themes/indigo-pink.css", "src/styles.scss" ],
I have added the reference to material in the styles.scss file (and remove the corresponding line in angular.json)
@import "~@angular/material/prebuilt-themes/indigo-pink.css"
With this configuration everything works fine.
@psrebrny, this comment is a little off topic. Reading your issue I see that you're trying to load the micro frontends in one single route. Can you help me to achieve the same result? How do you load remote module if not in the router conf? Thanks
@lincetto I didn't come to part 'router configuration' because I'm trying to serve the project,
@charles-7StarsSolutions I will try your solution, but now I have many other development tasks to do, maintenance has to wait.
Hi, I can confirm the problem is with the styles array. if you add one entry everything is fine. Two or more and ng serve doesn‘t work.
Hi, we have the same issue, but the very strange behaviour is that in my MacOS machine everything works, but in Windows machine of my colleagues 'ng serve' get stuck here :
> ng serve
√ Browser application bundle generation complete.
without starting the server. We tried also to remove the additional styles in order to have the array of only 1 element, but nothing changes.
@lincetto Do you have shared libs?
If yes, could you try to delete the .ts
extension from the path mapping inside tsconfig.json
.
// tsconfig.json
...
paths: {
"@app/shared": "libs/shared/index.ts" // <- remove .ts here
}
...
This can be another reason for stucking build processes.
If we run ng serve from inside src folder, it works, and is weird.. :) Ah, please note that the issue is not present in Linux or Mac environment, only in Windows. And in Windows we found the workaround to launch commands from the src folder.. I suppose the issue is related to this one https://github.com/angular-architects/module-federation-plugin/issues/16 that references this one from license-webpack-plugin package https://github.com/xz64/license-webpack-plugin/issues/95
As a workaround until this issue gets fixed you can add the following resolution beneath the webpack 5 entry:
"resolutions": { "webpack": "^5.0.0", "license-webpack-plugin": "^2.3.14" },
sharedMappings.getDescriptors return absolute path in import, change to path from repo root, it's fixed for me.
'@app/shared_lib': {
import: 'libs/shared_lib/src/index.ts',
singleton: true,
eager: false,
requiredVersion: false,
}
@lincetto Do you have shared libs? If yes, could you try to delete the
.ts
extension from the path mapping insidetsconfig.json
.// tsconfig.json ... paths: { "@app/shared": "libs/shared/index.ts" // <- remove .ts here } ...
This can be another reason for stucking build processes.
This took care of a really frustrating issue. Thank you @pschnoop
Thanks for pointing this out and for providing a workaround for this.
With version 12 of this lib, it works.
Introduction
At first, I wanted to say on a new project generated by ng cli it worked correctly, and building process builds files:
In my project, I tried searching difference in configurations to serve files after ng serve command but I couldn't find any sensible difference between them.
I haven't tried custom-webpack builder, previously, with other configuration it has served the files, but I don't know can I use it with ModuleFederationPlugin
Description
My application should be like a shell application like regular monorepo app, but one exception, in one routing I want to get outside the script and load it as micro frontend, currently, I load script on init app in index.html file.
after execute ng serve I see
as you can see it's lack of listing generated files.
package.json
angular.json
files: bootstrap.ts, main.ts, webpack.config.js and webpack.prod.config.js are untouched after schematics changed after command ng add @angular-architects/module-federation