Update old aurelia project

sorry to interrupt actual help… I suspect this was me, it was 1 year, and my solution was to blow away my entire webpack setup and generate a new one with the latest aurelia cli.

looks like I’m not the only one suggesting that.

though this post makes me wonder… maybe webpack is just a bad fragile piece of tech… and no one should use it…

1 Like

A little bit of backstory: at this point in time I have a huge application. So, naturally, I am using webpack chunks. Like a lot. This allows me to keep loading time somewhat manageable.

As for the Cyclic dependency error: I’ve hooked up a debugger to aurelia-cli just to see “what the heck html-webpack-plugin is sorting out there?”.

It turned out, that it was sorting “chunks”. And one of my chunks was referenced to itself.
webpack somewhere between version 4.29.4 and 4.42.1 changed how “chunks” was treated.

Yeap. As far as “chunks” logic goes - chunk that referenced on to it self, make no sense whatsoever.
webpack must at least issue a warning, if something like that happens. Or, better, throw an exception with appropriate error message.

As for the actual fix:
I had a few calls in main.js file:

aurelia.setRoot(PLATFORM.moduleName('app', 'backbone'));
...
aurelia.setRoot(PLATFORM.moduleName('auth/login', 'backbone'));

And a few such calls downstream.
Just remove chunkName for the calls that occurs downstream.
So make sure, you declaring “chunk” only once.

@bigopon Thanks for your suggestion. I will move on to the actual update after this discovery.

2 Likes