Angular AOT build error: Cannot find module 'utils/utils'


I’m getting a build build error for Angular 4 AOT builds: Cannot find module ‘utils/utils’. I’m importing into the component like so:
import * as utils from ‘utils/utils’;

I’m only getting the error on AOT builds. I’m using utils to open a web page and it is working without issues:

Any help would be appreciated


Are you sure it’s that, because I have been using utils and same method in Angular 4 and 5 now. Never had an issue with AOT compilation.


Not sure what version of NativeScript Webpack that you’re using, but if you’ve upgraded to 0.9.x, have you gone through these steps:

If not, maybe now is the time to upgrade some tools/dependencies?


I was able to fix it by using:
import * as utils from ‘tns-core-modules/utils/utils’;

instead of:
import * as utils from ‘utils/utils’;