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

[Error: SyntaxError: Unexpected number] #2

Open
mbejda opened this issue Dec 19, 2013 · 8 comments
Open

[Error: SyntaxError: Unexpected number] #2

mbejda opened this issue Dec 19, 2013 · 8 comments

Comments

@mbejda
Copy link

mbejda commented Dec 19, 2013

I keep getting this error when I'm trying to get the users feed. [Error: SyntaxError: Unexpected number]

vine.login(loginEmail, loginPassword, function (error, client) {
console.log(client) /// user information shows up. Authenti

vine.user('958614911402057728',{page:1,size:10},function(e,c)
{
console.log(e) /////error is here
console.log(c) ////
})

});

@mbejda
Copy link
Author

mbejda commented Dec 19, 2013

We forked the vinapple and and we think we fixed it.
In the vineapple.js we removed line 121 and it worked fine.

@furf
Copy link
Owner

furf commented Dec 19, 2013

Can you post a gist containing the native response? Originally, Vine was returning IDs greater than 32 bit as numbers. They would not parse properly, so I was wrapping them in quotes and casting them to strings before parsing. It is possible they changed something. I'd love to see what you're seeing as I've been unable to replicate here.

@mbejda
Copy link
Author

mbejda commented Dec 19, 2013

https://gist.github.com/mbejda/8043214

Notice the strange integers appearing outside the quotes.
Line 18,
Line 25,
...exc

@DaftMonk
Copy link

DaftMonk commented Jan 4, 2014

@mbejda Thanks for your fix. I had the same problem.

@judikdavid
Copy link

@mbejda same here, commenting out line 121 solve the error: . [Error: SyntaxError: Unexpected number]

@EggDice
Copy link

EggDice commented Feb 11, 2014

+1 fix it please!

@benomite
Copy link

Better than commenting line 121, you should replace line 21 with:

var VINE_ID_SEARCH = /("(?:(?:(?:comment|like|post|tag|user|venue)I)|i)d":\s*)(\d*)(,)?/g;

The problem is some of these ids are not 18 chars length, so the parsed result looks like:
{..., postId: "123456789012345678"9, ...} and JSON.parse function does not like it.

Replacing line 21 with the code above has corrected the problem for me and I'm able to use those big Ids as strings.

obj63mc added a commit to obj63mc/vineapple that referenced this issue Jun 10, 2014
@jspri
Copy link

jspri commented Jun 20, 2015

This was comitted in 9c71f2e and is now solved if anyone is feeling scared off

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

7 participants