views:

44

answers:

2

Since I posted this question, this issue has resolved itself. There must have been a glitch on Facebook or my dev server. Anyway, thanks to those of you who tried to help.

I have a Facebook app that runs on two servers: a live server and a dev server.

I was making some changes on dev and testing them when FBJS failed with an error (undefined functions)

I continuously reverted my changes to the dev server but could not get it working. So I reverted to the same revision that works on my live server, but it still fails on the dev server.

The source of the error appears to be a single JS file. I have verified in every way possible that this is the exact same file I am using on the live server where it works, but it is failing on the dev server with "undefined functions".

I am at my wits end with trying to debug this. I could really use some helpful suggestions. Thanks in advance for any help you can offer.

If you're interested in reviewing the apps, you can find there here:

Live: http://apps.facebook.com/rails_across_europe

Dev: http://apps.facebook.com/rails_dev

Note that you must give the app permission to access your FB profile data.

+1  A: 

Facebook caches external JS and CSS on FBML pages. Add a cache breaker to the JS URL:

http://example.com/js.js?version=1

what I do to automatically keep in sync is, during development, I append the current timestamp as a version number. Then, when I go live, I increment the live URL by 1. I've automated this as well, and I suggest you do the same.

Mike Sherov
A: 

Thank you for the suggestion Mike. I actually do append the timestamp to my JS files (e.g. 'http://example.com/Draw.js?ts=12345') But I'm wondering if this is working on the dev server, since it can't seem to find any of the functions in Draw.js. I'm not sure I understand what you mean when you say you 'increment the live URL by 1.' Do you mean you increment the timestamp by 1? Thanks.

Chris Barnhill
@Chris, actually, yesterday, Facebook was having issues with caching JS and CSS, so it could be that.
Mike Sherov