Even though I am using target esm2015, ivy is compiles as a esm5 module
For me this started showing after upgrading to Angular 9, and adding
"postinstall": "ngcc"
to scripts in package.json
fixed it.
ok,i, found it, in webpack i had to set [ 'es2015', 'browser', 'module', 'main'],,
https://github.com/angular/angular/issues/31853#issuecomment-515406475