Skip to content
This repository has been archived by the owner on Dec 18, 2019. It is now read-only.

JavaScript errors on page load #52

Closed
marcesher opened this issue Feb 3, 2015 · 6 comments
Closed

JavaScript errors on page load #52

marcesher opened this issue Feb 3, 2015 · 6 comments
Labels

Comments

@marcesher
Copy link

I see these errors in the JavaScript console when I load a morgue screen:

Uncaught TypeError: Cannot read property 'createPlugin' of undefined jquery.timeentry.min.js:6
Uncaught TypeError: undefined is not a function edit.js:27

This is on Chrome.

Morgue running behind apache, per the README

@cyberrodent
Copy link
Contributor

@marcesher It sounds like it might not be finding or loading https://github.com/etsy/morgue/blob/master/assets/js/jquery.timeentry-fr.js

Can you be more specific about "when I load a morgue screen" - is that the home screen, the create or edit screens, or just everything?
Are you seeing any other errors in your access logs?

@marcesher
Copy link
Author

@cyberrodent I get that error above on both the main List screen and also the Edit screen.

I see no 404 errors in dev tools or the apache log, but I also do not see the timeentry-fr.js file being pulled in. The only timeentry file I see is jquery.timeentry.min.js and timehelpers.js

Here's the result from the apache access log for a single page request:

my.ip - - [09/Feb/2015:11:23:02 -0500] "GET /events/1 HTTP/1.1" 200 51552 "http://morgue.demo/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.94 Safari/537.36"
my.ip - - [09/Feb/2015:11:23:03 -0500] "GET /assets/css/morgue.css?v= HTTP/1.1" 200 968 "http://morgue.demo/events/1" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.94 Safari/537.36"
my.ip - - [09/Feb/2015:11:23:03 -0500] "GET /assets/css/bootstrap-datepicker.css?v= HTTP/1.1" 200 4953 "http://morgue.demo/events/1" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.94 Safari/537.36"
my.ip - - [09/Feb/2015:11:23:03 -0500] "GET /assets/css/bootstrap-responsive.min.css?v= HTTP/1.1" 200 15545 "http://morgue.demo/events/1" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.94 Safari/537.36"
my.ip - - [09/Feb/2015:11:23:03 -0500] "GET /assets/css/image_sizing.css?v= HTTP/1.1" 200 186 "http://morgue.demo/events/1" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.94 Safari/537.36"
my.ip - - [09/Feb/2015:11:23:03 -0500] "GET /assets/css/chosen.css?v= HTTP/1.1" 200 11632 "http://morgue.demo/events/1" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.94 Safari/537.36"
my.ip - - [09/Feb/2015:11:23:03 -0500] "GET /assets/css/bootstrap.min.css?v= HTTP/1.1" 200 95583 "http://morgue.demo/events/1" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.94 Safari/537.36"
my.ip - - [09/Feb/2015:11:23:03 -0500] "GET /assets/js/bootstrap.js HTTP/1.1" 200 56216 "http://morgue.demo/events/1" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.94 Safari/537.36"
my.ip - - [09/Feb/2015:11:23:03 -0500] "GET /assets/js/api.js HTTP/1.1" 200 17770 "http://morgue.demo/events/1" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.94 Safari/537.36"
my.ip - - [09/Feb/2015:11:23:03 -0500] "GET /assets/js/chosen.jquery.min.js HTTP/1.1" 200 26966 "http://morgue.demo/events/1" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.94 Safari/537.36"
my.ip - - [09/Feb/2015:11:23:03 -0500] "GET /assets/js/bootstrap-datepicker.js HTTP/1.1" 200 13777 "http://morgue.demo/events/1" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.94 Safari/537.36"
my.ip - - [09/Feb/2015:11:23:03 -0500] "GET /assets/js/jquery.timeentry.min.js HTTP/1.1" 200 16298 "http://morgue.demo/events/1" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.94 Safari/537.36"
my.ip - - [09/Feb/2015:11:23:03 -0500] "GET /assets/js/jira.js HTTP/1.1" 200 2637 "http://morgue.demo/events/1" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.94 Safari/537.36"
my.ip - - [09/Feb/2015:11:23:03 -0500] "GET /assets/js/irc.js HTTP/1.1" 200 4222 "http://morgue.demo/events/1" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.94 Safari/537.36"
my.ip - - [09/Feb/2015:11:23:03 -0500] "GET /assets/js/tags.js HTTP/1.1" 200 2129 "http://morgue.demo/events/1" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.94 Safari/537.36"
my.ip - - [09/Feb/2015:11:23:03 -0500] "GET /assets/js/images.js HTTP/1.1" 200 1480 "http://morgue.demo/events/1" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.94 Safari/537.36"
my.ip - - [09/Feb/2015:11:23:03 -0500] "GET /assets/js/markdown.js HTTP/1.1" 200 47153 "http://morgue.demo/events/1" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.94 Safari/537.36"
my.ip - - [09/Feb/2015:11:23:03 -0500] "GET /assets/js/timehelpers.js HTTP/1.1" 200 4999 "http://morgue.demo/events/1" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.94 Safari/537.36"
my.ip - - [09/Feb/2015:11:23:03 -0500] "GET /assets/js/bootstrap-popover.js HTTP/1.1" 200 3147 "http://morgue.demo/events/1" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.94 Safari/537.36"
my.ip - - [09/Feb/2015:11:23:03 -0500] "GET /assets/js/bootstrap-tooltip.js HTTP/1.1" 200 7921 "http://morgue.demo/events/1" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.94 Safari/537.36"
my.ip - - [09/Feb/2015:11:23:03 -0500] "GET /assets/js/forums.js HTTP/1.1" 200 3262 "http://morgue.demo/events/1" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.94 Safari/537.36"
my.ip - - [09/Feb/2015:11:23:03 -0500] "GET /assets/js/edit.js HTTP/1.1" 200 1632 "http://morgue.demo/events/1" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.94 Safari/537.36"
my.ip - - [09/Feb/2015:11:23:03 -0500] "GET /assets/js/severity_tooltip.js HTTP/1.1" 200 570 "http://morgue.demo/events/1" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.94 Safari/537.36"
my.ip - - [09/Feb/2015:11:23:03 -0500] "GET /events/1/summary HTTP/1.1" 200 70 "http://morgue.demo/events/1" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.94 Safari/537.36"
my.ip - - [09/Feb/2015:11:23:03 -0500] "GET /assets/img/glyphicons-halflings-white.png HTTP/1.1" 200 8777 "http://morgue.demo/assets/css/bootstrap.min.css?v=" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.94 Safari/537.36"

@cyberrodent
Copy link
Contributor

Oops - jquery.timeentry.min.js is indeed the file we care about. Sorry for the mix up.

The error you are getting may indicate that you're not able to load jquery. This isn't bundled with the morge code, we're trying to pull it in from https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js. If you're in a closed network this might be the problem. Jquery not loading should show on in the dev-tools console

@marcesher
Copy link
Author

@cyberrodent

Thanks for the reply. I do indeed see jquery and jquery-ui pulling in
successfully from googleapis.com

The error seems to indicate that either it doesn't know what $.JQPlugin is,
or else it's not yet loaded

On Mon, Feb 9, 2015 at 5:52 PM, CyberRodent notifications@github.com
wrote:

Oops - jquery.timeentry.min.js is indeed the file we care about. Sorry for
the mix up.

The error you are getting may indicate that you're not able to load
jquery. This isn't bundled with the morge code, we're trying to pull it in
from https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js. If
you're in a closed network this might be the problem. Jquery not loading
should show on in the dev-tools console


Reply to this email directly or view it on GitHub
#52 (comment).

@cyberrodent
Copy link
Contributor

Progress!

D'oh! I didn't realize I was working with an older checkout. After updating my checkout I am also seeing this error. I beieved it was introduced in some recent-ish changes to the js libs.

In particular it seems we now need to pull in jquery.plugin.min.js which was added in and then removed in
2c670e4#diff-85ff945734f052d7eebff625ffc86042L181

Adding that line back in removes the error you are reporting, and I'd be happy to merge in a pull req for that. I'd also like to take a closer look at that set patches to see if there is anything else that might needs a tweak. Looks like there are some new options for locale which may require someone to also add a locale-specific file if they are using a new locale.

cyberrodent added a commit that referenced this issue Feb 28, 2015
Revert "Merge pull request #48 from arnaudlimbourg/update-js-libraries" Addresses some JS issues (#53, #52, #50)
@cyberrodent
Copy link
Contributor

as of a21b943 this should be resolved

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants