SyntaxError: Unexpected identifier 'code'

Hello,

Everything was ok in my app 2 days, but suddenly I’m getting an error with an onClick.

SyntaxError: Unexpected identifier ‘code’

I’m not sure what “code” is – it’s not a variable name I’ve created, not the name of a header, etc.

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

Suggestions on resolution? I’m not much of a JS programmer. Thanks!

Hi! Can you please share a screenshot of the onClick event of the button, the JS Object, and the API, respectively?

Thanks!

onClick:
onclick

API

And the js object

export default {
	saveInfo: () => {
		var authheader=btoa(input_gh_username.text + ":" + input_gh_pat.text);
		storeValue("ghuser",input_gh_username.text,true);
		storeValue("ghrepo",input_repo.text,true);
		storeValue("name",input_name.text,true);
		storeValue("ghbranch",input_branch.text,true);
		api_gh_user.run(this.onSuccess, this.onError, {'header': authheader});
		return ""
	},
	onSuccess: () => {
		storeValue("avatarurl",api_gh_user.data.avatar_url,true)
		storeValue("ghcollabs",api_gh_user.data.collaborators,true)
		storeValue("path","",true)
	  showAlert("Configuration Updated","success")
		closeModal("modal_configure")
		return ""
	},
	onError: e => {
		console.log(e)
		showAlert("Error: " + e)
		return ""
	}
}

Thanks. Could you please also share a screenshot of the Errors tab?

Thank you so much for sharing JS code @sullo
If it’s okay with you can you share your app else we can get on a call to debug this further?

Here is the error.

I can’t do a call today but tomorrow I can (Tue 1/24).

Let’s do a call today then. please suggest a convenient time for you.

I should have time tomorrow and would love to get this sorted out. Can we DM somehow to arrange the details?