manfredsteyer / multi-framework-micro-frontend

77 stars 36 forks source link

A bunch of MFE build errors after bootstrap #6

Open billy-briggs-dev opened 2 years ago

billy-briggs-dev commented 2 years ago

After performing the initial yarn bootstrap

mfe2: An unhandled exception occurred: Cannot find module 'ngx-build-plus/package.json

I tried manually adding the dependency using yarn, but then this nasty error popped up:

This version of CLI is only compatible with Angular versions ^13.0.0 || ^13.1.0-next, but Angular version 12.2.15 was found instead.

My local package for Mfe2 has CLI v12.2.14. So I thought maybe the version of ngx-build-plus v13.0.1 was incompatible with angular 12. So I downgraded to v12.2.0 for ngx-build-plus. Then we get another missing module error:

An unhandled exception occurred: Cannot find module 'typed-assert'

I manually added that dependency aswell, and the angular CLI version mismatch error appeared again.

This version of CLI is only compatible with Angular versions ^13.0.0 || ^13.1.0-next, but Angular version 12.2.15 was found instead.

Any help or ideas for cleaning up these dependencies would be greatly appreciated!

vugar005 commented 2 years ago

I had same problem and I installed using npm i on each repo.

billy-briggs-dev commented 2 years ago

Thanks I'll give that a go!

ninjabhishek commented 2 years ago

this was helpful! however, you can change yarn to npm in lerna.json at root, remove node_modules everywhere and can still execute bootstrap to achieve this. looks like yarn.lock has stuffs missing/incorrect

vugar005 commented 2 years ago

yes, yarn was mainly used to solve 'resolve' feature in package.json which was needed for Angular v11 to install webpack 5 since it was using webpack 4 by default.

mannb1 commented 2 years ago

I have made the code changes in the example from the pull request to 'Change lerna config to use npm and add lazy loaded mfe3 module', but I am a bit confused as to what the steps are now, do I need to delete all node_modules from each project and then what? do I need to install, bootstrap and start again and if so what exact commands do I use now? Are they all now npm?

npm -- Install dependencies npm bootstrap -- Install dependencies of all micro frontends and shell with lerna npm start -- Starts the shell and all Micro Frontends with lerna

Any help would be greatly appreciated, I would love to get this example up and running