Issue Collector throws: "Uncaught TypeError: Cannot read property 'msie' of undefined"

Anson Hoyt
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 29, 2013

After adding a Jira Issue Collector to one of my sites, I get this exception during page load:

Uncaught TypeError: Cannot read property 'msie' of undefined

com.atlassian.jira.collector.plugin.jira-issue-collector-plugin:issuecollector-embededjs.js:1

I'm guessing this is an IssueCollector problem, but anyone know the cause?

2 answers

1 accepted

1 vote
Answer accepted
Anson Hoyt
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 29, 2013

I am using jQuery 1.9.0. This the plugin's Javascript is relying on the long-deprecated jQuery.browser property, which was removed in jQuery 1.9.0.

See http://jquery.com/upgrade-guide/1.9/#jquery-browser-removed

Example of offending code:

if($.browser.msie&&(ATL_JQ.isQuirksMode()||$.browser.version<9))

The Issue Collector needs to be updated to work with jQuery 1.9. Vote for JRA-31576 if you so desire.

So, you have two options to get rid of this exception:

  1. Use jQuery Migrate to restore the deprecated APIs, as per this JIRA Knowledge Base article (thanks Pietro!)
  2. Downgrade jQuery to pre-1.9.0 until JRA-31576 is resolved.
Anson Hoyt
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 8, 2013

Updated to reference Pietro's documented workaround and reference JRA-31576 so you can vote for a non-workaround solution.

1 vote
pschaff01
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 4, 2013

Hi Anson,

The problem is that you have updated JQuery and $.browser was [removed in ver 1.9|http://jquery.com/upgrade-guide/1.9/#jquery-browser-removed]. To solve this you have two options:

  • Use the following code:
navigator.appName == 'Microsoft Internet Explorer'

This will have the same effect as:

$.browser.msie

  • Use [Jquery Migrate|https://github.com/jquery/jquery-migrate/] that allows using removed functions and gives a notice about removed functions (in the console.log).

Cheers,

Dmitry Tretyakov March 17, 2013

Hi Pietro,

when you plan to fix this bug and update collector?

Anson Hoyt
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 8, 2013

Pietro has since documented this workaround and referenced JRA-31576, so you can vote and watch the issue.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events