Parse-SDK-JS: "_synchronizeAllAuthData is not a function" when running in production after 2.9.0 update

Issue Description

After updating to Parse 2.9.0, we started noticing a new error when running Parse.User.current(), but only when running in production. Downgrading to 2.8.0 fixes the issue. The error thrown is:

TypeError: n._synchronizeAllAuthData is not a function
  at Object.currentUser (ParseUser.js:1266)

Steps to reproduce

  1. Run a web app using the Parse SDK v2.9.0 in production (NODE_ENV=production)
  2. Successfully authenticate as user using Parse.User.logIn method
  3. Reload the web page and trigger Parse.User.current()

Expected Results

Should return a Parse.User object with the current user.

Actual Outcome

Throws error: “_synchronizeAllAuthData is not a function”

Environment Setup

  • Server

    • parse-server version (Be specific! Don’t say ‘latest’.) : 3.9.0
    • Operating System: Mac OS 10.14.5
    • Hardware: MacBook Pro 2019
    • Localhost or remote server? (AWS, Heroku, Azure, Digital Ocean, etc): Localhost
  • JS SDK

    • JS SDK version: 2.9.0
    • Application? (Browser, Node, React-Native, etc): VueJS App

Logs/Trace

ParseUser.js:1266 Uncaught (in promise) TypeError: n._synchronizeAllAuthData is not a function
    at Object.currentUser (ParseUser.js:1266)
    at Function.value (ParseUser.js:781)
    at actions.ts:81
    at l (runtime.js:45)
    at Generator._invoke (runtime.js:271)
    at Generator.M.forEach.e.<computed> [as next] (runtime.js:97)
    at qe (app.c0811891.js:1)
    at a (app.c0811891.js:1)
    at app.c0811891.js:1
    at new Promise (<anonymous>)

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 23 (15 by maintainers)

Commits related to this issue

Most upvoted comments

I always use _User. And yes, to me it’s really handy to create my own customized User subclasses with the functions and props my apps need. I usually work on Angular (typescript).

@josenriq thanks for having a look at the issue. I’ll try your solution.

@josenriq thanks for reporting a fix. I can do a PR that will register to both User and _User.

@RaschidJFR did you try clearing your cache / refresh the browser?

I opened a PR https://github.com/parse-community/Parse-SDK-JS/pull/999.

Can you see if it works for you?

Hey guys the issue is caused by https://github.com/parse-community/Parse-SDK-JS/pull/978

Looks like this doesn’t like minified code (ParseUser doesn’t exist as it has been minified to a variable like ‘e’). We could revert this or someone can try a PR.