I'm getting the run time error below after upgrading our Angular application from Angular 7.2 to Angular 8.1 and updating core-js from 2.6.2 to 3.1.4. Our application does not use the Angular CLI, we just use webpack directly. Keeping the core-js version at 2.6.2 works just fine. What is the proper way of loading this polyfill manually with the new version of core-js?
The old polyfill.ts would load core-js as follows:
import 'core-js/es6';
import 'core-js/es7/reflect';
I tried the following with the new core-js but no luck:
import 'core-js/es'
import 'core-js/es/reflect'
Error:
Uncaught Error: Can't resolve all parameters for Location: (?, ?).
at syntaxError (webpack-internal:///./node_modules/@angular/compiler/fesm5/compiler.js:2687)
at CompileMetadataResolver._getDependenciesMetadata (webpack-internal:///./node_modules/@angular/compiler/fesm5/compiler.js:21589)
at CompileMetadataResolver._getTypeMetadata (webpack-internal:///./node_modules/@angular/compiler/fesm5/compiler.js:21481)
at CompileMetadataResolver._getInjectableTypeMetadata (webpack-internal:///./node_modules/@angular/compiler/fesm5/compiler.js:21704)
at CompileMetadataResolver.getProviderMetadata (webpack-internal:///./node_modules/@angular/compiler/fesm5/compiler.js:21713)
at eval (webpack-internal:///./node_modules/@angular/compiler/fesm5/compiler.js:21651)
at Array.forEach (<anonymous>)
at CompileMetadataResolver._getProvidersMetadata (webpack-internal:///./node_modules/@angular/compiler/fesm5/compiler.js:21611)
at eval (webpack-internal:///./node_modules/@angular/compiler/fesm5/compiler.js:21613)
at Array.forEach (<anonymous>)