Skip to content

[Amplitude] TypeError: Cannot read properties of undefined (reading 'save') in browser console #615

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

Closed
Stephen-Neel opened this issue Apr 18, 2025 · 2 comments
Labels
bug Something isn't working

Comments

@Stephen-Neel
Copy link

Stephen-Neel commented Apr 18, 2025

Expected Behavior

No error

Current Behavior

[Amplitude] TypeError: Cannot read properties of undefined (reading 'save') in browser console in below line.

  • e._useOldCookie ? e.cookieStorage.set(e.options.cookieName + e._storageSuffix, t) : e._metadataStorage.save(t)

Important

But after logging an event ex. amplitude.getInstance().logEvent('testevent', { type: 'local' }); then if amplitude.setOptOut(true/false) called there is no error!

Steps to Reproduce

  1. initialize amplitude.
  2. Try to set amplitude.setOptOut(true/false)

Environment

@Stephen-Neel Stephen-Neel added the bug Something isn't working label Apr 18, 2025
@Mercy811
Copy link
Contributor

Hi @Stephen-Neel, could you share a website url where we can reproduce this error? Thanks

@Stephen-Neel
Copy link
Author

Hi @Stephen-Neel, could you share a website url where we can reproduce this error? Thanks

Hi @Mercy811 Thank you for your response. We found out that we have custom sdk script which will initialize the amplitude (1st time if not initialized before) when we are calling the custom tracking function. This error happening while we are calling the optout without initializing amplitude.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants