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

TypeError: Assignment to constant variable. #308

Open
brunolemos opened this issue Sep 23, 2017 · 6 comments
Open

TypeError: Assignment to constant variable. #308

brunolemos opened this issue Sep 23, 2017 · 6 comments

Comments

@brunolemos
Copy link

brunolemos commented Sep 23, 2017

Happening when using x.sendNoRetry(message, { registrationTokens: [regToken] }, function (err, response) {

node-gcm v0.14.0
node v7.10.1

@hypesystem
Copy link
Collaborator

Hi @brunolemos ,

Can you show us the exact error message? And could you maybe show us the lines around the sendNoRetry call?

Have you defined message as a const? Or anything else?

Inside node-gcm we don't use const anywhere, so I'm trying to determine where this comes from.

Thanks for taking the time to report this :-)

Best,
Niels

@hypesystem
Copy link
Collaborator

Also, apparently this error can happen when assigning something to a name used by a function (see babel/babel#4166). Could this be the case anywhere in your code?

@eladnava
Copy link
Collaborator

eladnava commented Oct 5, 2017

Closing due to lack of response. Feel free to reopen if you are still experiencing this.

@eladnava eladnava closed this as completed Oct 5, 2017
@brunolemos
Copy link
Author

brunolemos commented Oct 5, 2017

The code was doing this two times: sender.sendNoRetry and newSender.sendNoRetry, using 2 different api keys (I think one was invalid/expired?). This is probably what was causing the issue, I removed the one with old api key and seems fine now.

@hypesystem
Copy link
Collaborator

That seems a bit odd imo! Were they two separate senders? Their state shouldn't be constant afaik.

I would love to see a stack trace on this, or the code as it was when the error occurred 😄

@hypesystem
Copy link
Collaborator

(So we can figure out exactly what went wrong and get it fixed!)

@eladnava eladnava reopened this Oct 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants