flex-layout and ContextElementDependency errors – MEAN upgrade

While attempting to update my current version of SERINDA to Angular 7 I was using the Mean.io boilerplate.  There are a few lines of instructions and that’s it. No other instructions to be found anywhere.  That annoys me, however, it is quite complete, in my opinion, on what I’d need.  If I don’t like this, the code I write will still be portable to some other MEAN stack.  For now, it is what it is.

The first issue was a flex-layout compile issue like this.

I made a few upgrades:
rxjs to 6.2.0
@angular/* were upgraded to 6.1.10
typescript was upgraded to 2.9.2

The second error was harder to find in the package.json and required some google-fu to find this gem which led to this gem.

No module factory available for dependency type: ContextElementDependency

I actually didn’t follow the steps from the stackoverflow reply exactly.

I check for duplicate webpacks installed – which I had, same as the reply.
Then I just uninstalled the webpack and checked to see that only one was installed.
I then reinstalled the @angular-devkit/build-angular and then double check one more time to see that there’s now only one webpack installed.

sudo npm ls webpack
sudo npm uninstall webpack
sudo npm ls webpack
sudo npm install @angular-devkit/build-angular@latest 
sudo npm ls webpack

Both of these changes led to a successful build of the mean.io framework with /ng build/.

I then started MongoDB and the startup script for Mean.io and everything works just fine now.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.