Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account
This post has been closed. You can still view previous posts, but you can't post any new replies.

SyntaxError: Unexpected token | on all campaigns on Dev server, even when no scripts

1514707636
Chris D.
Pro
Sheet Author
API Scripter
Compendium Curator
Both my campaigns on the DEV server are showing this error "SyntaxError: Unexpected token |" on the API scripts page. Your scripts are currently disabled due to an error that was detected. Please make appropriate changes to your scripts and click the "Save Script" button and we'll attempt to start running them again. More info... For reference, the error message generated was: SyntaxError: Unexpected token | I don't think the problem is my scripts. I think that something broke on the DEV server. I have not been on the DEV server for over a week. As I recall, I think everything was working more or less OK when last I was in it. Today I made a few changes to the roll templates section of my custom character sheet, and tried it out. I saw the above error message. I tested the code through closure compiler, and there were no errors or warnings. I rolled my changes back, and the error message still appeared. I then started deleting whole scripts. Even after I deleted every script, and the html and css of the character sheet, so it was a totally codeless campaign, the error message was still saying I had an unexpected token | somewhere. But without any scripts or custom html, I had no tokens anywhere. I then went to my test campaign (on the DEV server), which I occasionally use to test small code fragments. It was showing the same error. with the code that happened to be loaded upon it (different code). I then went to my real campaign on the production server. It was working fine. I then loaded my new code onto the production server, and it works fine there. So both my campaigns on the dev server always give the same error, no matter what scripts or character sheet is loaded, or even with no scripts or character sheets loaded. The same code on the production server seems to work fine. For a while I was willing to believe that the new code on the DEV server is more picky, and was picking up an existing error in my code that the production server was not having any problem with, but like I said, I still get the error message even after deleting everything deleteable! So I think there is a bug on the Dev server, introduced at least 2 days ago, but less than 10 days ago, wherein it says there is an unexpected token | even when there are no non-blank scripts loaded. 
1514713795

Edited 1514740538
Chris D.
Pro
Sheet Author
API Scripter
Compendium Curator
I decided to try creating a brand new campaign on the DEV server to see what happened.  When I first created a totally new and blank campaign, and went into the API section it of course said  For reference, the error message generated was: Error downloading scripts (probably no scripts exist for campaign.) as I would expect it to. If I then click the "new script" button, and rename untitled default blank script to junk.js and save it, the error message I get is  For reference, the error message generated was: Error setting up state: SyntaxError: Unexpected end of JSON input which seems wrong to me.  If I then add some code to the previously blank junk.js such as  var junky = 10; {     let x = 1; } Every time I save it, I still get the  For reference, the error message generated was: Error setting up state: SyntaxError: Unexpected end of JSON input error message that my scripts are disabled.  If I get rid of junk.js and instead try to ether pick or import scripts from the script library, I still get the error message For reference, the error message generated was: Error setting up state: SyntaxError: Unexpected end of JSON input So something seems very wrong with the DEV server. Existing campaigns are getting the unexpected token error message. Brand new campaigns are getting the unexpected end of JSON input error message. And there seems no way to use custom scripts on the DEV server.  I have heard of one person having problems similar to me. Are other people able to use the DEV server with scripts?
I think you mean DEV server in your last two paragraphs?
1514740583
Chris D.
Pro
Sheet Author
API Scripter
Compendium Curator
Yes, thank you, I did mean something seems wrong on the DEV server. I have editited it. 
1514744452
Gid
Roll20 Team
We passed a  very large update to DEV this past week where we rolled out a completely new rebuild of our built-in WebRTC. That error you're seeing is probably due to some unexpected conflict with the new update. We'll be able to look into this after New Years.
1514788917

Edited 1514788947
vÍnce
Pro
Sheet Author
I'm having the same issue. SyntaxError: Unexpected token |
1514859902

Edited 1514859967
I'm getting the same message. SyntaxError: Unexpected token | I even tried to disable all my scripts and delete/reinstall them on at a time. Still same message.
Does anyone know if there's an ETA to this fix?
I second that.
1515028384
Chris D.
Pro
Sheet Author
API Scripter
Compendium Curator
So is the Dev server unusable for everybody who uses the API, or just some of us? I usually use the Dev server for development and run my game on the production server. The last week I have been doing dev in my main campaign space, and sometimes a player pops in to update a character sheet or something and the sheet is not working!
1515029996
Kirsty
Pro
Sheet Author
I had the same problem. I brought over one of my games so that we could test the new video/voice, but had to switch back because the api was unusable.
Hi everyone! Thank you for again for catching this issue! We actually have a fix in the works and it should be out soon to make sure this problem is resolved. I will drop an update here once we get it pushed out.
Is there an ETA on when the fix will come out? I'm holding off on running a campaign because of it, and my players are getting antsy.
Looks like it is working now. Just tried adding scripts with no issues.
1515207701
vÍnce
Pro
Sheet Author
Restarted my sandbox and it does appear to be working again.  weeeeee
Woohoo!!! I just tried it, and everything is working beautifully!!!
Appears the devs may have had the fix rolling out while I was away :) I will go ahead and mark as resolved and close this thread. If you notice any further issues please feel free to create a new post! Happy gaming!