This is a migrated thread and some comments may be shown as answers.

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

3 Answers 640 Views
AppBuilder extension for Visual Studio
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Brad
Top achievements
Rank 1
Brad asked on 04 Aug 2015, 07:22 PM

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?

3 Answers, 1 is accepted

Sort by
0
Anton Dobrev
Telerik team
answered on 05 Aug 2015, 02:54 PM
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.

 
0
Brad
Top achievements
Rank 1
answered on 05 Aug 2015, 03:51 PM

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

 ​

0
Anton Dobrev
Telerik team
answered on 06 Aug 2015, 10:43 AM
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.

 
Tags
AppBuilder extension for Visual Studio
Asked by
Brad
Top achievements
Rank 1
Answers by
Anton Dobrev
Telerik team
Brad
Top achievements
Rank 1
Share this question
or