I just hit this exact issue with Angular 6 using the CLI and workspaces to create a library using ng g library foo
.
In my case the issue was in the tsconfig.lib.json
in the library folder which did not have es2017
included in the lib
section.
Anyone stumbling across this issue with Angular 6 you just need to ensure that you update you tsconfig.lib.json
as well as your application tsconfig.json