I have been using amplitude with Angular up to V11 with no problems. After upgrading to Angular 15.2.9 and trying to compile the project I get the following error:
./libs/***/analytics.service.ts:6:22-43 - Error: export 'getInstance' (imported as 'amplitude') was not found in 'amplitude-js' (possible exports: default)
./libs/***/analytics.service.ts:40:25-43 - Error: export 'Identify' (imported as 'amplitude') was not found in 'amplitude-js' (possible exports: default)
The analytics.service.ts looks like this:
import { Injectable } from '@angular/core';
import * as amplitude from 'amplitude-js';
@Injectable()
export class AnalyticsService {
private amInstance = amplitude.getInstance();
[...]
Summary
I have been using amplitude with Angular up to V11 with no problems. After upgrading to Angular 15.2.9 and trying to compile the project I get the following error:
The analytics.service.ts looks like this:
Here is an excerpt from my package.json
Thanks for any tips!