locked
amd is not defined RRS feed

  • Question

  • Since today, the following error is returned when trying to load the Bing Map Library.

    "Uncaught ReferenceError: amd is not defined"

    It seems to come from a race condition because the error doesn't appear systematically.

    Can it come from the September release ?

    URL : https://www.bing.com/mapspreview/sdk/mapcontrol?branch=release

    "window.define = window.define || amd.define;"

    The issue can be hotfixed temporarly by adding :

    window.amd = {
    define : function() {}
    };

    Thursday, October 6, 2016 10:04 AM

Answers

  • The team is investigating the root cause as it appears something has changed in the hosting platform which is causing this issue. No code was changed in any of the Bing Maps branches. In the mean time a partial workaround has been suggested in this thread: https://social.msdn.microsoft.com/Forums/en-US/31063241-34a2-4787-82ba-8e58bf1a2800/uncaught-referenceerror-amd-is-not-defined?forum=bingmaps

    [Blog] [twitter] [LinkedIn]

    Thursday, October 6, 2016 3:14 PM
  • The below code is working fine.

    <script type="text/javascript">

            var amd;(function(n){function e(n,i,u){t[n]||(t[n]={dependencies:i,callback:u},r(n))}function r(){if(arguments.length==0){if(!f){for(var n in t)u(n);f=!0}return i}if(arguments.length==1)return u(arguments[0])}function u(n){var s,e;if(i[n])return i[n];if(t.hasOwnProperty(n)){var h=t[n],f=h.dependencies,l=h.callback,a=r,o={},c=[a,o];if(f.length<2)throw error("invalid usage");else if(f.length>2)for(s=f.slice(2,f.length),e=0;e<s.length;e++)c.push(u(s[e]));return l.apply(this,c),i[n]=o,o}}function o(){return t}var t={},i={},f=!1;n.define=e;n.require=r;n.getModules=o})(amd||(amd={}));var define=amd.define,require=amd.require,getModules=amd.getModules

     

            </script>

     

    Thursday, October 6, 2016 4:52 PM
  • The code is pretty much the same as it was yesterday before the issue started.

    [Blog] [twitter] [LinkedIn]

    Thursday, October 6, 2016 10:04 PM
  • Update: The hotfix has gone through code review and testing. It is now being pushed out to our data centers/servers now and should be live within the next 30 to 45 minutes.

    [Blog] [twitter] [LinkedIn]

    Thursday, October 6, 2016 7:22 PM
  • Update: As soon as I pressed send on the last update I started seeing V8 working on external sites again. You should start seeing it load again on your sites as the hotfix rolls our across our data centers/servers.

    If you license Bing Maps (i.e. are a paying customer), make sure you have logged an incident with the Bing Maps Enterprise support team. This will allow them to send you an incident report in the next week or so with details on this incident. If you do not have contact details for the support team, you can find them here:  https://www.microsoft.com/maps/support.aspx


    [Blog] [twitter] [LinkedIn]

    Thursday, October 6, 2016 7:33 PM
  • The hotfix is still rolling out to data centers/servers. I've had a few others who have confirmed that they are seeing this working in their regions. It should reach your local data center soon if it hasn't already. Also try pressing ctrl+F5 in your browser to refresh to make sure you don't have a caching issue.

    [Blog] [twitter] [LinkedIn]

    Thursday, October 6, 2016 8:00 PM

All replies

  • I'm seeing same issue on a production service; just started after redployment.

    Thought it was due to using experimental branch, but have reverted to standard release, and still having same issue as above - amd is not defined.

    Snippet

    window.Logger=Logger;window.define=window.define||amd.define;window.require=window.require||amd.require

    Thursday, October 6, 2016 11:16 AM
  • Hi All

    Even from yesterday I am getting the same error.

    Unhandled exception at line 14, column 2800 in https://www.bing.com/api/maps/mapcontrol?callback=GetMap&branch=release

    0x800a1391 - JavaScript runtime error: 'amd' is undefined

    After multiple times refresh this goes away but again very frequently this error comes back.

    Please fix this at the earliest. Production is now broken for me.


    Thursday, October 6, 2016 11:21 AM
  • Hello, 

    Same issue production is not working. Rapid hot fix please!!


    Thursday, October 6, 2016 11:50 AM
  • We need the fix at the earliest. Any updates?

    Here is the code snippet. The error is on the bold line.

    window.InstrumentationBase=InstrumentationBase;
    window.Logger=Logger;
    window.define=window.define||amd.define;
    window.require=window.require||amd.require;
    Dragonfly["{experimental}"]=!0;


    Thursday, October 6, 2016 11:56 AM
  • Hi everybody,

    Due to the same error, may I ask you one simple question:

    WHY DO YOU MODIFY AND PUT ONLINE CODE IN THE BRANCHES RELEASE AND FROZEN INSTEAD OF DOING IT ONLY IN EXPERIMENTAL ? 

    That's not the first time and you are putting down so many web sites !!!


    • Edited by VEHICALL Thursday, October 6, 2016 12:07 PM
    Thursday, October 6, 2016 12:06 PM
  • Yes, this is really not ok.
    Thursday, October 6, 2016 12:11 PM
  • Hi everybody,

    Due to the same error, may I ask you one simple question:

    WHY DO YOU MODIFY AND PUT ONLINE CODE IN THE BRANCHES RELEASE AND FROZEN INSTEAD OF DOING IT ONLY IN EXPERIMENTAL ? 

    That's not the first time and you are putting down so many web sites !!!


    very true.
    Thursday, October 6, 2016 12:13 PM
  • Same error for me:

    Uncaught ReferenceError: amd is not defined

    Thursday, October 6, 2016 12:25 PM
  • found a fix:

    https://social.msdn.microsoft.com/Forums/en-US/31063241-34a2-4787-82ba-8e58bf1a2800/uncaught-referenceerror-amd-is-not-defined?forum=bingmaps

    Thursday, October 6, 2016 12:52 PM
  • The fix worked for chrome but now I am getting "Promise is undefined" error in Internet Explorer. This wasn't happening yesterday either. There should be no release branch as this entire thing seems to still be in beta.
    Thursday, October 6, 2016 12:56 PM
  • Yes, I agree with BingCommander that v8 seems rushed. Now this.

    I too get the 'Promise' error in IE so the hack for 'amd' is not a viable hack for the majority of users or websites.


    Thursday, October 6, 2016 1:05 PM
  • I too have been facing the same problem and am still with

    'amd' is undefined . mapcontrol (14,2800)

    Any solution yet!!!

    Thursday, October 6, 2016 1:36 PM
  • Hi everybody,

    Due to the same error, may I ask you one simple question:

    WHY DO YOU MODIFY AND PUT ONLINE CODE IN THE BRANCHES RELEASE AND FROZEN INSTEAD OF DOING IT ONLY IN EXPERIMENTAL ? 

    That's not the first time and you are putting down so many web sites !!!


    Bing V8 has been very poorly designed and not developer friendly to create user friendly features.


    • Edited by Ekambar Rao Thursday, October 6, 2016 1:39 PM
    Thursday, October 6, 2016 1:39 PM
  • So many useful and friendly features as MapTypeId:auto or useInertia:false or tileBuffer:x were also removed versus V7 halas...
    Thursday, October 6, 2016 1:56 PM
  • IE 11 needs a promise library from https://github.com/taylorhakes/promise-polyfill
    Thursday, October 6, 2016 1:58 PM
  • The team is investigating the root cause as it appears something has changed in the hosting platform which is causing this issue. No code was changed in any of the Bing Maps branches. In the mean time a partial workaround has been suggested in this thread: https://social.msdn.microsoft.com/Forums/en-US/31063241-34a2-4787-82ba-8e58bf1a2800/uncaught-referenceerror-amd-is-not-defined?forum=bingmaps

    [Blog] [twitter] [LinkedIn]

    Thursday, October 6, 2016 3:14 PM
  • Glad to read that's not Bing Maps team fault :-)

    Thursday, October 6, 2016 3:19 PM
  • The below code is working fine.

    <script type="text/javascript">

            var amd;(function(n){function e(n,i,u){t[n]||(t[n]={dependencies:i,callback:u},r(n))}function r(){if(arguments.length==0){if(!f){for(var n in t)u(n);f=!0}return i}if(arguments.length==1)return u(arguments[0])}function u(n){var s,e;if(i[n])return i[n];if(t.hasOwnProperty(n)){var h=t[n],f=h.dependencies,l=h.callback,a=r,o={},c=[a,o];if(f.length<2)throw error("invalid usage");else if(f.length>2)for(s=f.slice(2,f.length),e=0;e<s.length;e++)c.push(u(s[e]));return l.apply(this,c),i[n]=o,o}}function o(){return t}var t={},i={},f=!1;n.define=e;n.require=r;n.getModules=o})(amd||(amd={}));var define=amd.define,require=amd.require,getModules=amd.getModules

     

            </script>

     

    Thursday, October 6, 2016 4:52 PM
  • IE 11 needs a promise library from https://github.com/taylorhakes/promise-polyfill
    Actually IE 11 does not need the Promise library. It worked fine through Wednesday. The hack provided resolves the issue temporarily and hopefully we can remove the hack soon.
    Thursday, October 6, 2016 5:23 PM
  • Having the same problem here! my production webapps are down because of this!

    Bernardo Salazar

    Thursday, October 6, 2016 5:28 PM
  • Update: Getting the root issue resolved is taking longer than expected. To speed things up the Bing Maps V8 team is going to push out a hotfix for this issue.

    [Blog] [twitter] [LinkedIn]


    Thursday, October 6, 2016 5:44 PM
  • Many thanks for your appreciated push out, Ricky !
    Thursday, October 6, 2016 6:10 PM
  • Update: The hotfix has gone through code review and testing. It is now being pushed out to our data centers/servers now and should be live within the next 30 to 45 minutes.

    [Blog] [twitter] [LinkedIn]

    Thursday, October 6, 2016 7:22 PM
  • Update: As soon as I pressed send on the last update I started seeing V8 working on external sites again. You should start seeing it load again on your sites as the hotfix rolls our across our data centers/servers.

    If you license Bing Maps (i.e. are a paying customer), make sure you have logged an incident with the Bing Maps Enterprise support team. This will allow them to send you an incident report in the next week or so with details on this incident. If you do not have contact details for the support team, you can find them here:  https://www.microsoft.com/maps/support.aspx


    [Blog] [twitter] [LinkedIn]

    Thursday, October 6, 2016 7:33 PM
  • Just tried and we are still seeing issues in our environment. How long do you think it will be before we see this resolved?
    Thursday, October 6, 2016 7:50 PM
  • The hotfix is still rolling out to data centers/servers. I've had a few others who have confirmed that they are seeing this working in their regions. It should reach your local data center soon if it hasn't already. Also try pressing ctrl+F5 in your browser to refresh to make sure you don't have a caching issue.

    [Blog] [twitter] [LinkedIn]

    Thursday, October 6, 2016 8:00 PM
  • This fix is not working with an Angular 2 application. Simply adding the script reference causes the application to stay in a "loading..." state:

    https://plnkr.co/edit/C7EM9NbX2k38RclN1wSo

    This occurs regardless of where you place the script tag.

    Thursday, October 6, 2016 9:01 PM
  • The code is pretty much the same as it was yesterday before the issue started.

    [Blog] [twitter] [LinkedIn]

    Thursday, October 6, 2016 10:04 PM