{"id":1881,"date":"2013-08-26T03:17:01","date_gmt":"2013-08-26T03:17:01","guid":{"rendered":"http:\/\/www.garysieling.com\/blog\/?p=1881"},"modified":"2013-08-26T03:17:01","modified_gmt":"2013-08-26T03:17:01","slug":"fixing-the-error-typeerror-undefined-is-not-a-function-evaluating-globalscopeconsolelog-bindglobalscopeconsole","status":"publish","type":"post","link":"https:\/\/www.garysieling.com\/blog\/fixing-the-error-typeerror-undefined-is-not-a-function-evaluating-globalscopeconsolelog-bindglobalscopeconsole\/","title":{"rendered":"Fixing the error &#8220;TypeError: &#8216;undefined&#8217; is not a function (evaluating &#8216;globalScope[&#8216;console&#8217;][&#8216;log&#8217;].bind(globalScope[&#8216;console&#8217;])&#8217;)&#8221;"},"content":{"rendered":"<p>Some libraries, like PDF.js, initialize their own logging function, which wraps console.log<sup><a href=\"#footnote_1_1881\" id=\"identifier_1_1881\" class=\"footnote-link footnote-identifier-link\" title=\"https:\/\/github.com\/thoughtbot\/capybara-webkit\/issues\/459\">1<\/a><\/sup>. If this runs in a context where function.bind does not exist, you&#8217;ll get the following error:<\/p>\n<pre>TypeError: 'undefined' is not a function \n(evaluating 'globalScope['console']['log'].\nbind(globalScope['console'])')<\/pre>\n<p>Fixing this is actually quite simple- Mozilla provides a replacement function<sup><a href=\"#footnote_2_1881\" id=\"identifier_2_1881\" class=\"footnote-link footnote-identifier-link\" title=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/JavaScript\/Reference\/Global_Objects\/Function\/bind\">2<\/a><\/sup> you can drop-in (not surprising, considering how close the behavior of bind is to call and apply).<\/p>\n<p>Simply drop this code in, and you should be good to go for any environment.<\/p>\n<pre lang=\"Javascript\">if (!Function.prototype.bind) {\n  Function.prototype.bind = function (oThis) {\n    if (typeof this !== \"function\") {\n      \/\/ closest thing possible to the ECMAScript 5 internal IsCallable function\n      throw new TypeError(\n        \"Function.prototype.bind - what is trying to be bound is not callable\");\n    }\n\n    var aArgs = Array.prototype.slice.call(arguments, 1), \n        fToBind = this, \n        fNOP = function () {},\n        fBound = function () {\n          return fToBind.apply(this instanceof fNOP &amp;&amp; oThis\n            ? this\n            : oThis,\n            aArgs.concat(Array.prototype.slice.call(arguments)));\n        };\n\n    fNOP.prototype = this.prototype;\n    fBound.prototype = new fNOP();\n\n    return fBound;\n  };\n}<\/pre>\n<ol class=\"footnotes\"><li id=\"footnote_1_1881\" class=\"footnote\">https:\/\/github.com\/thoughtbot\/capybara-webkit\/issues\/459<span class=\"footnote-back-link-wrapper\"> [<a href=\"#identifier_1_1881\" class=\"footnote-link footnote-back-link\">&#8617;<\/a>]<\/span><\/li><li id=\"footnote_2_1881\" class=\"footnote\">https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/JavaScript\/Reference\/Global_Objects\/Function\/bind<span class=\"footnote-back-link-wrapper\"> [<a href=\"#identifier_2_1881\" class=\"footnote-link footnote-back-link\">&#8617;<\/a>]<\/span><\/li><\/ol>","protected":false},"excerpt":{"rendered":"<p>Some libraries, like PDF.js, initialize their own logging function, which wraps console.log1. If this runs in a context where function.bind does not exist, you&#8217;ll get the following error: TypeError: &#8216;undefined&#8217; is not a function (evaluating &#8216;globalScope[&#8216;console&#8217;][&#8216;log&#8217;]. bind(globalScope[&#8216;console&#8217;])&#8217;) Fixing this is actually quite simple- Mozilla provides a replacement function2 you can drop-in (not surprising, considering how &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.garysieling.com\/blog\/fixing-the-error-typeerror-undefined-is-not-a-function-evaluating-globalscopeconsolelog-bindglobalscopeconsole\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Fixing the error &#8220;TypeError: &#8216;undefined&#8217; is not a function (evaluating &#8216;globalScope[&#8216;console&#8217;][&#8216;log&#8217;].bind(globalScope[&#8216;console&#8217;])&#8217;)&#8221;&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"footnotes":""},"categories":[13],"tags":[302,418,426,591],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 4.9.9 - aioseo.com -->\n\t<meta name=\"description\" content=\"Some libraries, like PDF.js, initialize their own logging function, which wraps console.log ((https:\/\/github.com\/thoughtbot\/capybara-webkit\/issues\/459)). If this runs in a context where function.bind does not exist, you&#039;ll get the following error: TypeError: &#039;undefined&#039; is not a function (evaluating &#039;globalScope[&#039;console&#039;][&#039;log&#039;]. bind(globalScope[&#039;console&#039;])&#039;) Fixing this is actually quite simple- Mozilla provides a replacement function ((https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/JavaScript\/Reference\/Global_Objects\/Function\/bind)) you can drop-in (not surprising,\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"gary\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/www.garysieling.com\/blog\/fixing-the-error-typeerror-undefined-is-not-a-function-evaluating-globalscopeconsolelog-bindglobalscopeconsole\/\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 4.9.9\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"Gary Sieling - Software Engineer\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"Fixing the error \u201cTypeError: \u2018undefined\u2019 is not a function (evaluating \u2018globalScope[\u2018console\u2019][\u2018log\u2019].bind(globalScope[\u2018console\u2019])\u2019)\u201d - Gary Sieling\" \/>\n\t\t<meta property=\"og:description\" content=\"Some libraries, like PDF.js, initialize their own logging function, which wraps console.log ((https:\/\/github.com\/thoughtbot\/capybara-webkit\/issues\/459)). If this runs in a context where function.bind does not exist, you&#039;ll get the following error: TypeError: &#039;undefined&#039; is not a function (evaluating &#039;globalScope[&#039;console&#039;][&#039;log&#039;]. bind(globalScope[&#039;console&#039;])&#039;) Fixing this is actually quite simple- Mozilla provides a replacement function ((https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/JavaScript\/Reference\/Global_Objects\/Function\/bind)) you can drop-in (not surprising,\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/www.garysieling.com\/blog\/fixing-the-error-typeerror-undefined-is-not-a-function-evaluating-globalscopeconsolelog-bindglobalscopeconsole\/\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2013-08-26T03:17:01+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2013-08-26T03:17:01+00:00\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n\t\t<meta name=\"twitter:title\" content=\"Fixing the error \u201cTypeError: \u2018undefined\u2019 is not a function (evaluating \u2018globalScope[\u2018console\u2019][\u2018log\u2019].bind(globalScope[\u2018console\u2019])\u2019)\u201d - Gary Sieling\" \/>\n\t\t<meta name=\"twitter:description\" content=\"Some libraries, like PDF.js, initialize their own logging function, which wraps console.log ((https:\/\/github.com\/thoughtbot\/capybara-webkit\/issues\/459)). If this runs in a context where function.bind does not exist, you&#039;ll get the following error: TypeError: &#039;undefined&#039; is not a function (evaluating &#039;globalScope[&#039;console&#039;][&#039;log&#039;]. bind(globalScope[&#039;console&#039;])&#039;) Fixing this is actually quite simple- Mozilla provides a replacement function ((https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/JavaScript\/Reference\/Global_Objects\/Function\/bind)) you can drop-in (not surprising,\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"BlogPosting\",\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/fixing-the-error-typeerror-undefined-is-not-a-function-evaluating-globalscopeconsolelog-bindglobalscopeconsole\\\/#blogposting\",\"name\":\"Fixing the error \\u201cTypeError: \\u2018undefined\\u2019 is not a function (evaluating \\u2018globalScope[\\u2018console\\u2019][\\u2018log\\u2019].bind(globalScope[\\u2018console\\u2019])\\u2019)\\u201d - Gary Sieling\",\"headline\":\"Fixing the error &#8220;TypeError: &#8216;undefined&#8217; is not a function (evaluating &#8216;globalScope[&#8216;console&#8217;][&#8216;log&#8217;].bind(globalScope[&#8216;console&#8217;])&#8217;)&#8221;\",\"author\":{\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/author\\\/gary\\\/#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/#organization\"},\"datePublished\":\"2013-08-26T03:17:01+00:00\",\"dateModified\":\"2013-08-26T03:17:01+00:00\",\"inLanguage\":\"en-US\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/fixing-the-error-typeerror-undefined-is-not-a-function-evaluating-globalscopeconsolelog-bindglobalscopeconsole\\\/#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/fixing-the-error-typeerror-undefined-is-not-a-function-evaluating-globalscopeconsolelog-bindglobalscopeconsole\\\/#webpage\"},\"articleSection\":\"Javascript Code Examples, javascript, pdf.js, phantomjs, webkit\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/fixing-the-error-typeerror-undefined-is-not-a-function-evaluating-globalscopeconsolelog-bindglobalscopeconsole\\\/#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.garysieling.com\\\/blog\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/category\\\/javascript-code-examples\\\/#listItem\",\"name\":\"Javascript Code Examples\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/category\\\/javascript-code-examples\\\/#listItem\",\"position\":2,\"name\":\"Javascript Code Examples\",\"item\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/category\\\/javascript-code-examples\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/fixing-the-error-typeerror-undefined-is-not-a-function-evaluating-globalscopeconsolelog-bindglobalscopeconsole\\\/#listItem\",\"name\":\"Fixing the error &#8220;TypeError: &#8216;undefined&#8217; is not a function (evaluating &#8216;globalScope[&#8216;console&#8217;][&#8216;log&#8217;].bind(globalScope[&#8216;console&#8217;])&#8217;)&#8221;\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/fixing-the-error-typeerror-undefined-is-not-a-function-evaluating-globalscopeconsolelog-bindglobalscopeconsole\\\/#listItem\",\"position\":3,\"name\":\"Fixing the error &#8220;TypeError: &#8216;undefined&#8217; is not a function (evaluating &#8216;globalScope[&#8216;console&#8217;][&#8216;log&#8217;].bind(globalScope[&#8216;console&#8217;])&#8217;)&#8221;\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/category\\\/javascript-code-examples\\\/#listItem\",\"name\":\"Javascript Code Examples\"}}]},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/#organization\",\"name\":\"Gary Sieling\",\"description\":\"Software Engineer\",\"url\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/author\\\/gary\\\/#author\",\"url\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/author\\\/gary\\\/\",\"name\":\"gary\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/fixing-the-error-typeerror-undefined-is-not-a-function-evaluating-globalscopeconsolelog-bindglobalscopeconsole\\\/#authorImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/0be925276d848ffe98a6a9dc8cf33e67?s=96&d=identicon&r=g\",\"width\":96,\"height\":96,\"caption\":\"gary\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/fixing-the-error-typeerror-undefined-is-not-a-function-evaluating-globalscopeconsolelog-bindglobalscopeconsole\\\/#webpage\",\"url\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/fixing-the-error-typeerror-undefined-is-not-a-function-evaluating-globalscopeconsolelog-bindglobalscopeconsole\\\/\",\"name\":\"Fixing the error \\u201cTypeError: \\u2018undefined\\u2019 is not a function (evaluating \\u2018globalScope[\\u2018console\\u2019][\\u2018log\\u2019].bind(globalScope[\\u2018console\\u2019])\\u2019)\\u201d - Gary Sieling\",\"description\":\"Some libraries, like PDF.js, initialize their own logging function, which wraps console.log ((https:\\\/\\\/github.com\\\/thoughtbot\\\/capybara-webkit\\\/issues\\\/459)). If this runs in a context where function.bind does not exist, you'll get the following error: TypeError: 'undefined' is not a function (evaluating 'globalScope['console']['log']. bind(globalScope['console'])') Fixing this is actually quite simple- Mozilla provides a replacement function ((https:\\\/\\\/developer.mozilla.org\\\/en-US\\\/docs\\\/Web\\\/JavaScript\\\/Reference\\\/Global_Objects\\\/Function\\\/bind)) you can drop-in (not surprising,\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/fixing-the-error-typeerror-undefined-is-not-a-function-evaluating-globalscopeconsolelog-bindglobalscopeconsole\\\/#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/author\\\/gary\\\/#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/author\\\/gary\\\/#author\"},\"datePublished\":\"2013-08-26T03:17:01+00:00\",\"dateModified\":\"2013-08-26T03:17:01+00:00\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/\",\"name\":\"Gary Sieling\",\"description\":\"Software Engineer\",\"inLanguage\":\"en-US\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/#organization\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"Fixing the error \u201cTypeError: \u2018undefined\u2019 is not a function (evaluating \u2018globalScope[\u2018console\u2019][\u2018log\u2019].bind(globalScope[\u2018console\u2019])\u2019)\u201d - Gary Sieling","description":"Some libraries, like PDF.js, initialize their own logging function, which wraps console.log ((https:\/\/github.com\/thoughtbot\/capybara-webkit\/issues\/459)). If this runs in a context where function.bind does not exist, you'll get the following error: TypeError: 'undefined' is not a function (evaluating 'globalScope['console']['log']. bind(globalScope['console'])') Fixing this is actually quite simple- Mozilla provides a replacement function ((https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/JavaScript\/Reference\/Global_Objects\/Function\/bind)) you can drop-in (not surprising,","canonical_url":"https:\/\/www.garysieling.com\/blog\/fixing-the-error-typeerror-undefined-is-not-a-function-evaluating-globalscopeconsolelog-bindglobalscopeconsole\/","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"BlogPosting","@id":"https:\/\/www.garysieling.com\/blog\/fixing-the-error-typeerror-undefined-is-not-a-function-evaluating-globalscopeconsolelog-bindglobalscopeconsole\/#blogposting","name":"Fixing the error \u201cTypeError: \u2018undefined\u2019 is not a function (evaluating \u2018globalScope[\u2018console\u2019][\u2018log\u2019].bind(globalScope[\u2018console\u2019])\u2019)\u201d - Gary Sieling","headline":"Fixing the error &#8220;TypeError: &#8216;undefined&#8217; is not a function (evaluating &#8216;globalScope[&#8216;console&#8217;][&#8216;log&#8217;].bind(globalScope[&#8216;console&#8217;])&#8217;)&#8221;","author":{"@id":"https:\/\/www.garysieling.com\/blog\/author\/gary\/#author"},"publisher":{"@id":"https:\/\/www.garysieling.com\/blog\/#organization"},"datePublished":"2013-08-26T03:17:01+00:00","dateModified":"2013-08-26T03:17:01+00:00","inLanguage":"en-US","mainEntityOfPage":{"@id":"https:\/\/www.garysieling.com\/blog\/fixing-the-error-typeerror-undefined-is-not-a-function-evaluating-globalscopeconsolelog-bindglobalscopeconsole\/#webpage"},"isPartOf":{"@id":"https:\/\/www.garysieling.com\/blog\/fixing-the-error-typeerror-undefined-is-not-a-function-evaluating-globalscopeconsolelog-bindglobalscopeconsole\/#webpage"},"articleSection":"Javascript Code Examples, javascript, pdf.js, phantomjs, webkit"},{"@type":"BreadcrumbList","@id":"https:\/\/www.garysieling.com\/blog\/fixing-the-error-typeerror-undefined-is-not-a-function-evaluating-globalscopeconsolelog-bindglobalscopeconsole\/#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/www.garysieling.com\/blog#listItem","position":1,"name":"Home","item":"https:\/\/www.garysieling.com\/blog","nextItem":{"@type":"ListItem","@id":"https:\/\/www.garysieling.com\/blog\/category\/javascript-code-examples\/#listItem","name":"Javascript Code Examples"}},{"@type":"ListItem","@id":"https:\/\/www.garysieling.com\/blog\/category\/javascript-code-examples\/#listItem","position":2,"name":"Javascript Code Examples","item":"https:\/\/www.garysieling.com\/blog\/category\/javascript-code-examples\/","nextItem":{"@type":"ListItem","@id":"https:\/\/www.garysieling.com\/blog\/fixing-the-error-typeerror-undefined-is-not-a-function-evaluating-globalscopeconsolelog-bindglobalscopeconsole\/#listItem","name":"Fixing the error &#8220;TypeError: &#8216;undefined&#8217; is not a function (evaluating &#8216;globalScope[&#8216;console&#8217;][&#8216;log&#8217;].bind(globalScope[&#8216;console&#8217;])&#8217;)&#8221;"},"previousItem":{"@type":"ListItem","@id":"https:\/\/www.garysieling.com\/blog#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/www.garysieling.com\/blog\/fixing-the-error-typeerror-undefined-is-not-a-function-evaluating-globalscopeconsolelog-bindglobalscopeconsole\/#listItem","position":3,"name":"Fixing the error &#8220;TypeError: &#8216;undefined&#8217; is not a function (evaluating &#8216;globalScope[&#8216;console&#8217;][&#8216;log&#8217;].bind(globalScope[&#8216;console&#8217;])&#8217;)&#8221;","previousItem":{"@type":"ListItem","@id":"https:\/\/www.garysieling.com\/blog\/category\/javascript-code-examples\/#listItem","name":"Javascript Code Examples"}}]},{"@type":"Organization","@id":"https:\/\/www.garysieling.com\/blog\/#organization","name":"Gary Sieling","description":"Software Engineer","url":"https:\/\/www.garysieling.com\/blog\/"},{"@type":"Person","@id":"https:\/\/www.garysieling.com\/blog\/author\/gary\/#author","url":"https:\/\/www.garysieling.com\/blog\/author\/gary\/","name":"gary","image":{"@type":"ImageObject","@id":"https:\/\/www.garysieling.com\/blog\/fixing-the-error-typeerror-undefined-is-not-a-function-evaluating-globalscopeconsolelog-bindglobalscopeconsole\/#authorImage","url":"https:\/\/secure.gravatar.com\/avatar\/0be925276d848ffe98a6a9dc8cf33e67?s=96&d=identicon&r=g","width":96,"height":96,"caption":"gary"}},{"@type":"WebPage","@id":"https:\/\/www.garysieling.com\/blog\/fixing-the-error-typeerror-undefined-is-not-a-function-evaluating-globalscopeconsolelog-bindglobalscopeconsole\/#webpage","url":"https:\/\/www.garysieling.com\/blog\/fixing-the-error-typeerror-undefined-is-not-a-function-evaluating-globalscopeconsolelog-bindglobalscopeconsole\/","name":"Fixing the error \u201cTypeError: \u2018undefined\u2019 is not a function (evaluating \u2018globalScope[\u2018console\u2019][\u2018log\u2019].bind(globalScope[\u2018console\u2019])\u2019)\u201d - Gary Sieling","description":"Some libraries, like PDF.js, initialize their own logging function, which wraps console.log ((https:\/\/github.com\/thoughtbot\/capybara-webkit\/issues\/459)). If this runs in a context where function.bind does not exist, you'll get the following error: TypeError: 'undefined' is not a function (evaluating 'globalScope['console']['log']. bind(globalScope['console'])') Fixing this is actually quite simple- Mozilla provides a replacement function ((https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/JavaScript\/Reference\/Global_Objects\/Function\/bind)) you can drop-in (not surprising,","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/www.garysieling.com\/blog\/#website"},"breadcrumb":{"@id":"https:\/\/www.garysieling.com\/blog\/fixing-the-error-typeerror-undefined-is-not-a-function-evaluating-globalscopeconsolelog-bindglobalscopeconsole\/#breadcrumblist"},"author":{"@id":"https:\/\/www.garysieling.com\/blog\/author\/gary\/#author"},"creator":{"@id":"https:\/\/www.garysieling.com\/blog\/author\/gary\/#author"},"datePublished":"2013-08-26T03:17:01+00:00","dateModified":"2013-08-26T03:17:01+00:00"},{"@type":"WebSite","@id":"https:\/\/www.garysieling.com\/blog\/#website","url":"https:\/\/www.garysieling.com\/blog\/","name":"Gary Sieling","description":"Software Engineer","inLanguage":"en-US","publisher":{"@id":"https:\/\/www.garysieling.com\/blog\/#organization"}}]},"og:locale":"en_US","og:site_name":"Gary Sieling - Software Engineer","og:type":"article","og:title":"Fixing the error \u201cTypeError: \u2018undefined\u2019 is not a function (evaluating \u2018globalScope[\u2018console\u2019][\u2018log\u2019].bind(globalScope[\u2018console\u2019])\u2019)\u201d - Gary Sieling","og:description":"Some libraries, like PDF.js, initialize their own logging function, which wraps console.log ((https:\/\/github.com\/thoughtbot\/capybara-webkit\/issues\/459)). If this runs in a context where function.bind does not exist, you'll get the following error: TypeError: 'undefined' is not a function (evaluating 'globalScope['console']['log']. bind(globalScope['console'])') Fixing this is actually quite simple- Mozilla provides a replacement function ((https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/JavaScript\/Reference\/Global_Objects\/Function\/bind)) you can drop-in (not surprising,","og:url":"https:\/\/www.garysieling.com\/blog\/fixing-the-error-typeerror-undefined-is-not-a-function-evaluating-globalscopeconsolelog-bindglobalscopeconsole\/","article:published_time":"2013-08-26T03:17:01+00:00","article:modified_time":"2013-08-26T03:17:01+00:00","twitter:card":"summary_large_image","twitter:title":"Fixing the error \u201cTypeError: \u2018undefined\u2019 is not a function (evaluating \u2018globalScope[\u2018console\u2019][\u2018log\u2019].bind(globalScope[\u2018console\u2019])\u2019)\u201d - Gary Sieling","twitter:description":"Some libraries, like PDF.js, initialize their own logging function, which wraps console.log ((https:\/\/github.com\/thoughtbot\/capybara-webkit\/issues\/459)). If this runs in a context where function.bind does not exist, you'll get the following error: TypeError: 'undefined' is not a function (evaluating 'globalScope['console']['log']. bind(globalScope['console'])') Fixing this is actually quite simple- Mozilla provides a replacement function ((https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/JavaScript\/Reference\/Global_Objects\/Function\/bind)) you can drop-in (not surprising,"},"aioseo_meta_data":{"post_id":"1881","title":null,"description":null,"keywords":null,"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"BlogPosting","isEnabled":true},"graphs":[]},"schema_type":"default","schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"local_seo":null,"limit_modified_date":false,"created":"2023-02-04 16:07:56","updated":"2026-07-06 01:03:44","ai":null,"breadcrumb_settings":null,"seo_analyzer_scan_date":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.garysieling.com\/blog\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.garysieling.com\/blog\/category\/javascript-code-examples\/\" title=\"Javascript Code Examples\">Javascript Code Examples<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tFixing the error \u201cTypeError: \u2018undefined\u2019 is not a function (evaluating \u2018globalScope[\u2018console\u2019][\u2018log\u2019].bind(globalScope[\u2018console\u2019])\u2019)\u201d\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/www.garysieling.com\/blog"},{"label":"Javascript Code Examples","link":"https:\/\/www.garysieling.com\/blog\/category\/javascript-code-examples\/"},{"label":"Fixing the error &#8220;TypeError: &#8216;undefined&#8217; is not a function (evaluating &#8216;globalScope[&#8216;console&#8217;][&#8216;log&#8217;].bind(globalScope[&#8216;console&#8217;])&#8217;)&#8221;","link":"https:\/\/www.garysieling.com\/blog\/fixing-the-error-typeerror-undefined-is-not-a-function-evaluating-globalscopeconsolelog-bindglobalscopeconsole\/"}],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/posts\/1881"}],"collection":[{"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/comments?post=1881"}],"version-history":[{"count":0,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/posts\/1881\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/media?parent=1881"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/categories?post=1881"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/tags?post=1881"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}