appsmith: [Bug]: SyntaxError: Unexpected identifier ‘code’

Is there an existing issue for this?

  • I have searched the existing issues

Description

Everything was ok in my app 3 days (in the cloud), but suddenly I’m getting an error with an onClick.

image

I did not change any code during that time period. I do not have any object or variable name called code anywhere in my application.

Flow is: onClick()-> JS Object → API

Steps To Reproduce

Unsure. I suspect the JS Object’s issue is on this line because when I commented it, the function completed without error.

api_gh_user.run(this.onSuccess, this.onError, {'header': authheader})

Here is the API configuration image

Public Sample App

No response

Issue video log

No response

Version

Cloud

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 17 (9 by maintainers)

Most upvoted comments

Hello @sullo, I have found the problem. I am so sorry. This bug was introduced in the last release and the fix is going in an upcoming release. I have made changes in your code for now, check below it will work perfectly

in saveInfo function, this was your previous code api_gh_user.run(this.onSuccess, this.onError, {'header': authheader});

new code ~api_gh_user.run(() => this.onSuccess, () => this.onError, {'header': authheader});~ api_gh_user.run(() => this.onSuccess(), () => this.onError(), {'header': authheader});

old onError function line- showAlert("Error: " + e)

new onError function line showAlert("Error: " + e.message)

@ramsaptami Please check this scenario and can we please add a test case for this 😃