manfredsteyer / module-federation-with-angular-dynamic

Dynamic Module Federation with Angular
123 stars 69 forks source link

Not working for me with Angular 12 #18

Open laurentsd opened 3 years ago

laurentsd commented 3 years ago

I upgraded to Angular 12 and get the error GET http://localhost:5000/common.js net::ERR_ABORTED 404 (Not Found) I can see that common.js is not generated either by ng build shell Anyone has this working with Angular 12 and can share their changes? Thanks!

My package.json is { "name": "mf-demo", "version": "0.0.0", "scripts": { "ng": "ng", "start:shell": "ng serve shell", "start:mfe1": "ng serve mfe1", "start:mfe2": "ng serve mfe2", "build:shell": "ng build shell --configuration production", "build:mfe1": "ng build mfe1 --configuration production", "build:mfe2": "ng build mfe2 --configuration production", "start": "concurrently "npm run start:shell" "npm run start:mfe1" "npm run start:mfe2" ", "build": "npm run build:shell && npm run build:mfe1 && npm run build:mfe2", "test": "ng test", "lint": "ng lint", "e2e": "ng e2e" }, "private": true, "resolutions": { "webpack": "^5.0.0" }, "dependencies": { "@angular-architects/module-federation": "^12.1.1", "@angular-architects/module-federation-tools": "^0.0.1", "@angular/animations": "12.0.0", "@angular/common": "12.0.0", "@angular/compiler": "12.0.0", "@angular/core": "12.0.0", "@angular/forms": "12.0.0", "@angular/platform-browser": "12.0.0", "@angular/platform-browser-dynamic": "12.0.0", "@angular/router": "12.0.0", "@nrwl/workspace": "^10.3.0", "concurrently": "^5.3.0", "rxjs": "~6.6.0", "tslib": "^2.0.0", "zone.js": "~0.10.2" }, "devDependencies": { "@angular-devkit/build-angular": "^12.0.0", "@angular/cli": "^12.0.0", "@angular/compiler-cli": "^12.0.0", "@types/jasmine": "~3.5.0", "@types/jasminewd2": "~2.0.3", "@types/node": "^12.11.1", "codelyzer": "^6.0.0", "jasmine-core": "~3.6.0", "jasmine-spec-reporter": "~5.0.0", "karma": "~5.2.0", "karma-chrome-launcher": "~3.1.0", "karma-coverage": "~2.0.3", "karma-jasmine": "~4.0.0", "karma-jasmine-html-reporter": "^1.5.0", "ngx-build-plus": "11.0.0", "protractor": "~7.0.0", "serve": "^11.3.2", "ts-node": "~8.3.0", "tslint": "~6.1.0", "typescript": "~4.0.0" } }

stefanocke commented 3 years ago

I am quite sure the reason / fix is #14 The "common.js" is a chunk from a remote. But due to #14 webpack tries to load it from the shell.