Appbuilder Extension Upgrade | Everlive Uncaught TypeError: Cannot convert undefined or null to object

4 posts, 0 answers
  1. Brad
    Brad avatar
    3 posts
    Member since:
    Jun 2011

    Posted 04 Aug 2015 Link to this post

    After upgrading the Telerik appbuilder extension for Visual Studio I can't run my apps in the device simulator (I also can't build but I believe that's a separate issue - http://www.telerik.com/forums/cannot-build-any-project-after-upgrading-appbuilder-extension-2015-2-728-2).  

     

    Here's the error I get:
     everlive.all.js:28082 Uncaught TypeError: Cannot convert undefined or null to object

    Here is line 28082
     var modifierKeys = Object.keys(expression);

    Any ideas?  Do I need to post my code?
  2. Anton Dobrev
    Admin
    Anton Dobrev avatar
    539 posts

    Posted 05 Aug 2015 Link to this post

    Hi Brad,

    We are sorry to hear about the inconvenience you experienced. Supposedly the error is thrown by the Telerik Backend Services JavaScript SDK.

    You could check if you are not using a version of the SDK that is not incompatible with your current code (given that it tries to evaluate an expression).

    Could you please try the latest version of the SDK  - 1.5.1, available from here:

    https://bs-static.cdn.telerik.com/1.5.1/everlive.all.min.js

    or as a Bower package - search for everlive in AppBuilder > Manage Packages > Bower

    To avoid such issues in the future you may want to bind the app to a certain version of the SDK or install the SDK locally. You can use the methods specified here - http://docs.telerik.com/platform/backend-services/development/javascript-sdk/introduction

    If this does not solve the issue, please, provide a project that illustrates this behavior and we will be able to investigate it.

    Regards,
    Anton Dobrev
    Telerik
     

    Visit the Telerik Verified Plugins Marketplace and get the custom Cordova plugin you need, already tweaked to work seamlessly with AppBuilder.

     
  3. Brad
    Brad avatar
    3 posts
    Member since:
    Jun 2011

    Posted 05 Aug 2015 in reply to Anton Dobrev Link to this post

    I'm using https://bs-static.cdn.telerik.com/latest/everlive.all.js

    I tried using https://bs-static.cdn.telerik.com/1.5.1/everlive.all.min.js and had the same issue.

     

    Additionally, I'm getting a build error but I read somewhere else that this issue would be resolved with a hot fix later this week. 

    Error1Build failed: An item with the same key has already been added..
    System.ArgumentException: An item with the same key has already been added.
       at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
       at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
       at System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement](IEnumerable`1 source, Func`2 keySelector, Func`2 elementSelector, IEqualityComparer`1 comparer)
       at Telerik.BlackDragon.Client.Build.PrepareBuild.GetFilteredSourceFiles(ILogHelper logger)
       at Telerik.BlackDragon.Client.Build.PrepareBuild.ExecuteCore(IHttpServiceContext httpServiceContext, LogHelper logger)C:\Users\blinger\AppData\Local\Microsoft\VisualStudio\12.0\Extensions\zkoycrbs.dbm\Targets\Build.targets1494LiveDead.App

     ​

  4. Anton Dobrev
    Admin
    Anton Dobrev avatar
    539 posts

    Posted 06 Aug 2015 Link to this post

    Hi Brad,

    As to your questions.

    1. Build

    Indeed, the problem should be fixed with the latest release of the AppBuilder client. You should be prompted about the new version and I strongly suggest that you upgrade the extension.

    We tested with your app and the build passed successfully.

    2. The error in the JavaScript SDK

    It appears that versions of the SDK after 1.4.1 do not support null or undefined values passed to the filtering API. Because the value returned by localStorage.getItem('prayerplanid')  (see getUPGoftheDay in index.html) is null  the serialization of the filter throws the error.

    You can fix this in one of the following ways:

     - Use https://bs-static.cdn.telerik.com/1.4.1/everlive.all.min.js
     -
    Refactor your code to handle the null/undefined value of the filter, for example:
    if(localStorage.getItem('prayerplanid')) {
        query
            .where()
            .and()
            .eq('PrayerPlanID', localStorage.getItem('prayerplanid'))
            .gte('Date', app.functions.getEarliestPointoftheDay())
            .lte('Date', app.functions.getLatestPointoftheDay())
            .done();
    } else {
        query
            .where()
            .and()
            .gte('Date', app.functions.getEarliestPointoftheDay())
            .lte('Date', app.functions.getLatestPointoftheDay())
    }

    Let me know if this helps.

    Note: Since this is a public forum I edited your post to remove the link to the project.

    Regards,
    Anton Dobrev
    Telerik
     

    Visit the Telerik Verified Plugins Marketplace and get the custom Cordova plugin you need, already tweaked to work seamlessly with AppBuilder.

     
Back to Top