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

Can't duplicate games. Error - Uncaught TypeError: Cannot read property 'CampaignTags' of undefined

Hey guys, I find myself unable to duplicate games. This about as big a crisis as I can have over Roll20, since I have a library of almost 150 Pathfinder Society game rooms that I make clean copies of for players to go mess around in. I've got another game starting on Saturday and I can't make a copy of the room so we can't play until this gets fixed. Standard debugging steps below: Use the Right Browser Attempted in Chrome, Chromium, and Firefox, all on the latest releases, all on Ubuntu 18.10. Disable Extensions Totally not the problem in this case. I've tested with extension-laden browsers and without. Same problem. This page has worked reliably for me for ages. Clear your Cache Tried. Failed. No effect. Bug Report When copying a game, tags are not being copied over from the original game. This is a brand new issue as of today, as yesterday when I copied a game this was all working. Furthermore, when I attempt to make a copy of a game, the code tries to get to read the CampaignTags property of an undefined object, which is a pretty good reason to crash if you think about it. JQMIGRATE: Migrate is installed with logging active, version 3.0.0 v2.js?1559663001:57 JQMIGRATE: jQuery.fn.bind() is deprecated n @ v2.js?1559663001:57 bind @ v2.js?1559663001:57 (anonymous) @ 4762323:4294 v2.js?1559663001:57 console.trace n @ v2.js?1559663001:57 bind @ v2.js?1559663001:57 (anonymous) @ 4762323:4294 v2.js?1559663001:51 Uncaught SyntaxError: Unexpected end of JSON input     at JSON.parse (<anonymous>)     at M.i.initialize (browse.js?1559663001:158)     at M.i.e.View (v2.js?1559663001:106)     at new M.i (v2.js?1559663001:106)     at HTMLDivElement.<anonymous> (browse.js?1559663001:220)     at Function.each (v2.js?1559663001:50)     at t.fn.init.each (v2.js?1559663001:50)     at HTMLDocument.<anonymous> (browse.js?1559663001:219)     at d (v2.js?1559663001:51)     at h (v2.js?1559663001:51) initialize @ browse.js?1559663001:158 e.View @ v2.js?1559663001:106 M.i @ v2.js?1559663001:106 (anonymous) @ browse.js?1559663001:220 each @ v2.js?1559663001:50 each @ v2.js?1559663001:50 (anonymous) @ browse.js?1559663001:219 d @ v2.js?1559663001:51 h @ v2.js?1559663001:51 setTimeout (async) xt.readyException @ v2.js?1559663001:51 (anonymous) @ v2.js?1559663001:51 d @ v2.js?1559663001:51 h @ v2.js?1559663001:51 setTimeout (async) (anonymous) @ v2.js?1559663001:51 u @ v2.js?1559663001:51 fireWith @ v2.js?1559663001:51 fire @ v2.js?1559663001:51 u @ v2.js?1559663001:51 fireWith @ v2.js?1559663001:51 h @ v2.js?1559663001:51 setTimeout (async) (anonymous) @ v2.js?1559663001:51 u @ v2.js?1559663001:51 fireWith @ v2.js?1559663001:51 fire @ v2.js?1559663001:51 u @ v2.js?1559663001:51 fireWith @ v2.js?1559663001:51 ready @ v2.js?1559663001:51 h @ v2.js?1559663001:50 v2.js?1559663001:57 JQMIGRATE: jQuery.fn.unbind() is deprecated n @ v2.js?1559663001:57 unbind @ v2.js?1559663001:57 n.close_field @ v2.js?1559663001:119 n.test_active_click @ v2.js?1559663001:119 click_test_action @ v2.js?1559663001:119 dispatch @ v2.js?1559663001:51 g.handle @ v2.js?1559663001:51 v2.js?1559663001:57 console.trace n @ v2.js?1559663001:57 unbind @ v2.js?1559663001:57 n.close_field @ v2.js?1559663001:119 n.test_active_click @ v2.js?1559663001:119 click_test_action @ v2.js?1559663001:119 dispatch @ v2.js?1559663001:51 g.handle @ v2.js?1559663001:51 4762323:4378 Uncaught TypeError: Cannot read property 'CampaignTags' of undefined     at HTMLAnchorElement.<anonymous> (4762323:4378)     at HTMLAnchorElement.dispatch (v2.js?1559663001:51)     at HTMLAnchorElement.g.handle (v2.js?1559663001:51) Of this chunk of stuff , only the last four lines are related to the actual issue as far as I can tell.
Hi Alex, I went ahead and forwarded this over to our devs. Thanks! 
Thanks!
Hi Alex, Do your games employ tags (I would assume yes with that many but want to double check :) )? Does this behavior persist in a new game you create? In that new game, could you try both with and without tags? Could you let us know the name of a game that is confirmed to showcase this behavior so we can have a closer look? Thanks!
Thanks--I got in touch with support and I've got a decent short-term copy! I'm still at work so when I get home I'll be able to give you more information and some more debugging. As of last night, I was unable to copy anything, but I was able to create a new game. I'll see if those conditions still hold and if not what the new behavior is.
Well, that's interesting. The games I had made prior to a week ago--and copies thereof--can be copied. They all have tags. If I make a new game now, with or without tags, I can copy it. But both of the game rooms I built in the last week have tags and cannot be copied. The room I got help with can be copied if you remove all the tags from it, now, but if you add tags you can't copy it. If I make a copy of any of those rooms by removing the tags, I seem to be able to copy them--up until I add tags. The situation is improved from the other day, at least--I couldn't copy anything , and I tried! So this is definitely an improvement. I'd prefer not to lose those two rooms, of course, but it's not quite as dire.
A new data point: I've got a room I was working on for the first book in the Pathfinder adventure path Mummy's Mask. Since I had only just started on maps, I thought I'd transfer them to a new room that would be safe to copy. But when I transmogrified maps over to a "safe" copy of my template game, I stopped being able to make copies of this game as well. The corruption is contagious!
Hmm. But the corruption is not consistent . I tried to corrupt a previously existing game and was unable to. I'm not sure what this means. I really wish I could dig into your DB and see what was going on. I'm fumbling around in the dark over here, unfortunately!
I FIGURED THIS &*^#*(%&^#@(*$&^!!! thing out! Well, as much as I'm going to bother figuring out, anyway. There's a bug in the tag handling in the front end that's crashing anytime the front end tries to parse a tag with an apostrophe in it. My last couple of game rooms both had, by sheer and utter coincidence, tags with apostrophes in them . How unexpectedly sinister! I'm not sure exactly where in the JS this is happening--I spent 30 seconds poking at it and got as far as JSON.parse. The tags are passed correctly into the database though, and then they're sent to the browser in div.campaigntags. I'm not hugely enthralled by staring at minified JS so I think this is as far as my motivation will take me. <div class="campaigntags" data-campaignid="0" data-editable="true" data-hide-edit-button="true" data-auto-edit="true" data-initial-tags='[{"id":1859614,"tag":"Pathfinder","campaign_id":4762323},{"id":1859615,"tag":"PathfinderSociety","campaign_id":4762323},{"id":1859616,"tag":"PFS","campaign_id":4762323},{"id":1859617,"tag":"Source","campaign_id":4762323},{"id":1859618,"tag":"Tier-3-7","campaign_id":4762323},{"id":1859620,"tag":"Andoran","campaign_id":4762323},{"id":1859621,"tag":"Galt","campaign_id":4762323},{"id":1859622,"tag":"Season-09","campaign_id":4762323},{"id":1859623,"tag":"Cute","campaign_id":4762323},{"id":1861795,"tag":"Libertys-Edge","campaign_id":4762323},{"id":1861797,"tag":"Liberty's-Edge","campaign_id":4762323}]'></div> Whenever this set of tags is processed, the processing script crashes. If I remove the tag with the apostrophe, then everything starts working. It's a nice easy test case. It turns out this process is crashing further up the thread. I probably should have guessed that's what was going on, since the console error was "Uncaught SyntaxError: Unexpected end of JSON input" in that upper block. You know, your traditional "huh I wasn't expecting THAT character there AGH I'M DYING" error. Sorry to have a mountain with a punctuation molehill--it was a pretty big deal for me at the time so I really appreciate the help. I'm able to work around this amazingly easily so it's not a huge deal for me  now, but it'd be nice if you could look into it and fix the root of the issue someday soon so this doesn't cause someone else trouble.
Hi Alex, We certainly appreciate your extra motivation in this matter! I have made sure to update the tickets and poke the devs regarding your findings so this will help greatly in pinning down a root cause I am sure :)