locked
Visual Studio LightSwitch 2013 JavaScript runtime error: Unable to get property 'each' of undefined or null reference RRS feed

  • Question

  • Unhandled exception at line 1666, column 5 in http://localhost:51684/HTMLClient/Scripts/msls-2.0.0.js

    0x800a138f - JavaScript runtime error: Unable to get property 'each' of undefined or null reference

    The related code in msls-2.0.0.js is the block in bold:

        languages = readGlobalProperty("__msls_supportedLanguages", "EN-US");
        languages = languages.toUpperCase();
        languages = languages.split(";");
        $.each(languages, function (index, item) {
            item = $.trim(item);
            if (item) {
                supportedLanguages[item] = true;
            }
        });
    
        languages = [];

    I got this error after converting a Visual Studio 2010 LightSwitch Project that was failing to reveal errors. Rebuilding in VS2013LS actually displayed the errors and I was able to Rebuild successfully. I'm now faced with this runtime error that won't go away no matter what I try.

    Has anyone got any ideas that might help me get this sorted?


    Z A R D O Z

    Monday, September 16, 2013 11:36 AM

All replies

  • Hi,

    Perhaps this problem is related to Extensions,  there was a feedback about the usage of msls library, you could have a look at this link below, perhaps it can give some hints for you,

    # 0x800a138f - JavaScript runtime error

    Regards


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Monday, September 23, 2013 5:18 AM
  • Thanks for the post and link re extensions. Huy Nguyen had helped me before and that was one of the first possible solutions I considered. Unfortunaterly it did not solve my problem. In the week since I posted the unhandled exception error problem I've sorted the error by comparing a downloaded example LightSwitch 2013 RC Project and my HTMLClient \Content, \Content\Images and \Scripts, and getting them to match. I then pasted the 'default.htm' from the new downloaded example into my HTMLClient too. I think those were the things that eventually got rid of the error. I tried many different things that didn't work before that.

    Unfortunately I had to completely rewrite the project from scratch after that because I then started getting Server related issues and eventually just cut my losses.

    Sadly rewriting a project in 2013 seems to be the best approach IMO. Still getting strange errors when creating new tables though but I've found a work around by creating the new table then saving & restarting Visual Studio. That process seems to sync the model with the intrinsic localdb and I can continue working. I still find that I have to regularly save copies of my project in case it becomes corrupted for some reason or another. I've tried uninstalling and reinstalling Visual Studio 2013 RC but that makes zero difference. I'm running Win 7 64-bit, maybe VS2013RC is more reliable on Windows 8.1???

    I'm a big fan of Visual Studio 2013 updated LightSwitch IDE and the LightSwitch model based approach in particular, unfortunately I've yet to find stability when creating HTML Clients. There seem to be too many things that can go wrong and break a project. Lack of compatibility between jQuery and jQuery Mobile libraries and it's game over. A half day job has taken me over a week now so it's hard for me to be happy with that.


    Z A R D O Z

    Monday, September 23, 2013 8:33 AM
  • Hi Z A R D O Z

    Sorry for the issue that you are hitting now,

    "I'm running Win 7 64-bit, maybe VS2013RC is more reliable on Windows 8.1???"

    System requirements and platform compatibility for Visual Studio 2013 RC,

    Visual Studio 2013 support for Windows desktop development: Windows 8.1, Windows 8, Windows 7, etc.

    Visual Studio 2013 support for Windows Store app and Windows Phone development: Windows 8.1, Windows server 2012 R2, etc.

    At the same time when upgrading from Microsoft Visual Studio to Visual Studio 2013 you will take advantage of a refreshed and simplified environment with enhanced performance without any additional hardware requirements.

    Regards


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Tuesday, September 24, 2013 9:13 AM
  • Interestingly I just downloaded one of Michael Washington's sample VS2010LS apps called 'MySurvey'and converted it to VS2013LS. Same error msg as in my original post. It appears to confirm my suspicion that you can't really convert VS2012LS projects to VS2013LS. The upgrade log doesn't show any errors just warnings and none related to the HTMLClient:

    Migration Report - MySurvey

    Overview

    Project Path Errors Warnings Messages
    MySurvey MySurvey\MySurvey.ls3proj 0 1 12
    MySurvey.Server.csproj MySurvey\MySurvey.Server\MySurvey.Server.csproj 0 1 0
    Solution MySurvey.sln 0 1 1
    MySurvey.HTMLClient MySurvey\MySurvey.HTMLClient\MySurvey.HTMLClient.jsproj 0 0 0

    Sorry but this error persists and seems to appear with any upgraded VS2010LS project.

    ###UPDATE###: After half an hour I opened the project again to check the code and without thinking I tried to run it. This time it worked :-)  Seems that I had to close and reopen Visual Studio to get it to work properly. Same as getting new tables to propagate the model to the Sql localdb. Anyway I have to take back what I said apparently you can upgrade projects to VS2013LS just not my original problem project.


    Z A R D O Z


    • Edited by Z A R D O Z Tuesday, September 24, 2013 11:21 AM
    Tuesday, September 24, 2013 10:47 AM
  • Hi Z A R D O Z

    Glad that you converted Michael Washington's sample VS2010LS 'MySurvey' apps to VS 2013RC.

    For your original project, perhaps it is msls library that leads to this problem. First I'd like to suggest you to re-convert your VS 2010 project again, and check whether it still has same problem.

    Or you could also consider submitting this issue to Microsoft Connect site(https://connect.microsoft.com/),  Microsoft engineers will reproduce this issue according to the proof you provide, and they will evaluate this issue seriously.

    If it still has same issue, please don’t hesitate to let me know,

    Regards


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.


    • Edited by Angie Xu Wednesday, September 25, 2013 7:21 AM
    Wednesday, September 25, 2013 7:20 AM