Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export "getInstance" was not found in "amplitude-js" #607

Open
bureaug opened this issue Sep 15, 2023 · 1 comment
Open

Export "getInstance" was not found in "amplitude-js" #607

bureaug opened this issue Sep 15, 2023 · 1 comment
Labels
question Further information is requested

Comments

@bureaug
Copy link

bureaug commented Sep 15, 2023

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:

./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();
        [...]

Here is an excerpt from my package.json


	"dependencies": {
		"@angular/animations": "15.2.9",
		"@angular/cdk": "15.2.9",
		"@angular/common": "15.2.9",
		"@angular/compiler": "15.2.9",
		"@angular/core": "15.2.9",
		"@angular/forms": "15.2.9",
		"@angular/platform-browser": "15.2.9",
		"@angular/platform-browser-dynamic": "15.2.9",
		"@angular/router": "15.2.9",
		"amplitude-js": "^8.21.9",
		"reflect-metadata": "^0.1.10",
		"rxjs": "~6.6.3",
		"tslib": "^2.0.0",
		"zone.js": "0.12.0"
	},

Thanks for any tips!

@bureaug bureaug added the question Further information is requested label Sep 15, 2023
@bureaug
Copy link
Author

bureaug commented Sep 16, 2023

Moved to "@amplitude/analytics-browser": "^2.3.0" package, everything works fine now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant