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

FireFox TypeError: access to strict mode caller function is censored

19 Answers 177 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Fit2Page
Top achievements
Rank 1
Iron
Veteran
Iron
Fit2Page asked on 05 Jun 2018, 12:28 PM

Hi,

With the new Q2 2018 I get TypeError: access to strict mode caller function is censored on FireFox 60.0.1 and Chrome 66, when I use the upload function of the Editor.

 

This also happens when I try the same in the Telerik demo environment, please refer to screenshot .

BR, Marc

19 Answers, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 06 Jun 2018, 11:58 AM
Hello Marc,

The error indicates problems with the embedded jQuery 3.3.1 in the latest R2 2018 version of the Telerik ASP.NET AJAX control. The problem is discussed in the Known Issues and Important Changes sticky note and this bug report item and the temporary fix is to downgrade the jQuery version to 1.11.1.

You can see how to disable the internal jQuery version and use your own in RadEditor dialogs in this article: Disable the Embedded jQuery in RadEditor dialogs.
The problem will be fixed in the upcoming Service Pack of UI for ASP.NET AJAX, the release date of which is not yet available.

Best regards,
Rumen
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Jason
Top achievements
Rank 2
answered on 10 Jul 2018, 12:49 PM
@Rumen do you have an ETA for this fix yet?
0
Jason
Top achievements
Rank 2
answered on 10 Jul 2018, 12:56 PM

It's also happening on the RadAutoCompleteBox OnEntryAdded and OnEntryRemoved events

this is the definition of the control

                    <telerik:RadAutoCompleteBox
                        ID="Search"
                        runat="server"
                        EmptyMessage="Search for a Client"
                        InputType="Token"
                        CssClass="AutoCompleteBox"
                        Width="100%"                         
                        DropDownHeight="250px"
                        AllowCustomEntry="true"                                             
                        OnEntryAdded="Search_EntryChanged"
                        OnEntryRemoved="Search_EntryChanged"
                        AutoPostBack="true"
                        >
                        <WebServiceSettings Method="GetReportSearch" Path="/Private/Services/AutoComplete.asmx" />
                        <TokensSettings AllowTokenEditing="false" />
                    </telerik:RadAutoCompleteBox>

0
Marin Bratanov
Telerik team
answered on 10 Jul 2018, 01:20 PM
Hi Jason and anyone else with the same question,

The service pack should be live by the end of the week.


Regards,
Marin Bratanov
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
SK
Top achievements
Rank 1
answered on 26 Jul 2018, 08:44 PM

I am facing the same issue with the RadSearchBox, it happens when I am getting the search and cancel icons using  file.

in  file

<telerik:radsearchbox id="RadSearchBox1" runat="server"
    width="500"
    enableviewstate="true"
    enableautocomplete="false"
    datacontextkeyfield="id"
    showsearchbutton="false"
    EmptyMessage="Type here to Search:">
    <SearchContext ShowDefaultItem="false"></SearchContext>
    <Buttons>
        <telerik:SearchBoxButton
            CommandName="Search"
            ToolTip="Search"
            Position="Right"
            AlternateText="Search" />
        <telerik:SearchBoxButton
            CommandName="ClearSearch"
            ToolTip="Cancel"
            Position="Right"
            AlternateText="Cancel"  />
    </Buttons>
</telerik:radsearchbox>

 

In cs file

private void RadSearchBox1_PreRender(object sender, EventArgs e)
{
            var searchButton = RadSearchBox1.Buttons[0] as SearchBoxButton;
            searchButton.ImageUrl = "/images/icons/svg/dark/oc-search-1.svg";
            searchButton.CssClass = "svgIcon";
            (RadSearchBox1.Buttons[1] as SearchBoxButton).ImageUrl = "/images/icons/svg/dark/oc-cancel-1.svg";
}

 

Any input will be appreciated

0
Marin Bratanov
Telerik team
answered on 27 Jul 2018, 07:01 AM
Hi SK,

Could you confirm whether you have upgraded to R2 2018 SP1 (2018.2.710)? This issue is resolved there. You can test this on our demos to confirm (video of the expected results is attached below): https://demos.telerik.com/aspnet-ajax/searchbox/examples/programming/serverevents/defaultcs.aspx.


Regards,
Marin Bratanov
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
SK
Top achievements
Rank 1
answered on 31 Jul 2018, 08:59 PM
I can confirm that after upgrading to R2 2018 SP1 (2018.2.710) this problem is not happening. Thank you for solving this issue.
0
Accepted
Rumen
Telerik team
answered on 01 Aug 2018, 06:28 AM
Thank you for writing back and confirming that the problem is resolved in the latest version R2 2018 SP1 (2018.2.710)!


Kind regards,
Rumen
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Peter
Top achievements
Rank 1
answered on 11 Aug 2018, 03:10 PM

Hi,

FYI: I'm also using 2018.2.710, but the problem is still occuring.

When I call:             $find("<%= RaddTreeList.ClientID %>").fireCommand("Rebind","");

Regards, Peter

0
Marin Bratanov
Telerik team
answered on 11 Aug 2018, 03:27 PM
Hello Peter,

This seems to work fine in our demos. I am attaching here a short video that shows my testing steps and another one that shows how you can check the actual version used on the page. Could you confirm if you see 2018.2.710? Am I missing something in my test?


Regards,
Marin Bratanov
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Peter
Top achievements
Rank 1
answered on 12 Aug 2018, 11:12 AM

Hi Marin,

I can reproduce the behaviour:

If I fire the command in the console, it is working as expected.

($find("ctl00_cph1_RadTreeList1").fireCommand("Rebind",""))

In my scenario I try to rebind the RadTreeList in a SignalR Broadcast Message:

chatHub.client.broadcastMessage = function (user, message, add) {
 
            console.log("received message:" + user + ","+ message);
 
            $find("<%= RadTreeList1.ClientID %>").fireCommand("Rebind","");
 
        }

 

I this scenario I get the error with the call stack.

(In Chrome it is working) 

 

 

TypeError: access to strict mode caller function is censored Telerik.Web.UI.WebResource.axd:15:13769

_doPostBack
<anonym>
<anonym>
_executePostBackEvent
fireCommand
chatHub.client.broadcastMessage
makeProxyCallback/<
on/callbackMap[eventName][callback]
dispatch
add/y.handle
trigger
triggerHandler
hubConnection.fn.init/<
received/<
dispatch
add/y.handle
trigger
triggerHandler
triggerReceived
processMessages/<
each
processMessages
start/connection.socket.onmessage
 
0
Peter
Top achievements
Rank 1
answered on 12 Aug 2018, 11:33 AM

In Edge it is also working correctly.

It seems that only firefox has problems...

Regards Peter

0
Marin Bratanov
Telerik team
answered on 13 Aug 2018, 06:39 PM
Hi Peter,

This error is characteristic of jQuery3. Can you confirm the Telerik controls version that your project uses and of the jQuery referenced in the application?

I am attaching below a small example that seems to work fine for me and a short video of my tests so you can confirm if I am missing something. If you can reproduce this with my sample, can you post the modifications and the steps I am missing?

On a side note, the command name to rebind a treelist is "RebindTreeList", I'm sorry for missing this earlier. I've added it to the documentation.


Regards,
Marin Bratanov
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Josh
Top achievements
Rank 1
Veteran
answered on 23 Aug 2018, 05:13 PM

I am also having this same problem using Firefox.  I get the error when calling 

ajaxManager.ajaxRequest("dosomework");

from within a SignalR client call back.

Im on  Telerik version  2018.2.710

I was using jquery-3.3.1.   I attempted changing to jquery-1.12.4  as that is what is currently shown on the jquery site and disabling the embedded jquery.  SignalR started okay, but then it failed right after because in the jquery start function I have, Im using

raddock = $find("ctl00_ucChat_ChatDock");    Which comes back with null.   No idea why. This error doesn't not happen using jquery 3.3.1.   Seems there are too many conflicts to just revert to an earlier version of Jquery.    

Is this still being worked on?   Its definitely still a problem.

Changed it back to jquery3.3.1 and now signalR works and $find works, but still getting the error in firefox calling ajaxrequest form signalr client callback.  No problems in Chrome.

Here is more detail on the error if it helps. 

TypeError: access to strict mode caller function is censored Telerik.Web.UI.WebResource.axd:15:13769

_doPostBack http://pamsdevtest/Telerik.Web.UI.WebResource.axd:15:13769

Function.createDelegate/< http://pamsdevtest/Telerik.Web.UI.WebResource.axd:6:305

__doPostBack http://pamsdevtest/Telerik.Web.UI.WebResource.axd:41953:1

ajaxRequest http://pamsdevtest/Telerik.Web.UI.WebResource.axd:5325:27

 

0
Marin Bratanov
Telerik team
answered on 23 Aug 2018, 05:46 PM
Hello Josh,

The most likely reason for $find() to return undefined is that it is called too early, before the Sys.Application.Load event: https://docs.telerik.com/devtools/aspnet-ajax/general-information/get-client-side-reference#important-ms-ajax-events.

The jQuery we bring resides by default in the window.$telerik.$ variable, so it does not interfere with the global scope (we have added $telerik.$ = jQuery.noConflict(true); at the end of the jQuery file we put in our assembly). This means that you can use window.$ and window.jQuery with any other version you want, so you can attach SignalR to it, instead of to the version we bring. Assuming good encapsulation on jQuery's and SignalR's part, this should not cause interference.

If you can reproduce a problem in our code with our methods, with the R2 2018 SP1 release, I ask that you either post the modifications to my previous sample here, or open a support ticket and send us a simple runnable reproducible so we can investigate.


Regards,
Marin Bratanov
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Accepted
Josh
Top achievements
Rank 1
Veteran
answered on 28 Aug 2018, 08:18 PM

I couldn't get anything to work in my code and I also could not do anything to break your example, Marin.  Doing more research led me to search in all the loaded scripts for the "use strict" setting.  As it turns out, my signalr hub is configured in a way that generates a hubs.js file automatically in a signalr folder.  This auto-generated file had the "use strict' setting.  I wanted then to disable this, but since it's auto-generated I wasn't sure how, so I did more looking which led me to this thread which explains the issue and how to get around it.

https://github.com/SignalR/SignalR/issues/2964

 

So to get around this, I downloaded the auto-generated hubs.js file which was visible in the web console/debugger and placed in the scripts folder. Then I changed the html import of the script to point at the hubs.js in the scripts folder instead of using the signalr/hubs option. This resolves the issue completely, however anytime we add methods to signalr, we will need to regenerate and save the hubs.js file after commenting out the strict setting.  

I suspect that the reason it all works in your example, is that your code does not generate a hubs.js file and thus does not have the "use strict" getting plugged in anywhere. Hope this helps someone. I spent too many hours on it.

0
Marin Bratanov
Telerik team
answered on 29 Aug 2018, 01:37 AM
Hi Josh,

Thank you for your time and for sharing your solution with the community. I have highlighted your post as an answer and I also updated your Telerik point for your contribution.

Indeed, my sample uses a signalR script from the CDN and the hub is...really basic, so it does not generated.


Regards,
Marin Bratanov
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Accepted
JP
Top achievements
Rank 2
answered on 03 Dec 2018, 05:52 PM

I downloaded the latest version "2018.3.910" and the problem persists with an ajaxRequest call from within a jquery ajax response callback.

Essentially, my scenario is:

1. I make a jquery ajax call to my webapi.

2. When I get the api response, I find the ajaxManager and call the ajaxRequest method. (on Firefox this dies with the error message: "TypeError: access to strict mode caller function is censored")

I am using jQuery3. To fix it, I hack it like so:

setTimeout(function () {
    var ajaxManager = $find("<%=RadAjaxManager1.ClientID%>");
    ajaxManager.ajaxRequest('DoWork');
}, 0);

 

By wrapping in setTimeout, it executes outside of strict mode. Dirty trick, but it works.

0
Marin Bratanov
Telerik team
answered on 04 Dec 2018, 08:52 PM
Hello JP,

Thank you for sharing your solution with the community. I've marked it as an answer in case someone has a similar scenario, and you'll also find your Telerik points updated.

This error is to be expected when there is a jQuery 3.x loaded on the page (or any other script that adds 'use strict'). The MS AJAX framework accesses the .caller in some cases and Firefox blocks that in strict mode. There isn't anything we can do about this and I don't expect that an update to a WebForms set of scripts will be coming from Microsoft to address this.


Regards,
Marin Bratanov
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
Editor
Asked by
Fit2Page
Top achievements
Rank 1
Iron
Veteran
Iron
Answers by
Rumen
Telerik team
Jason
Top achievements
Rank 2
Marin Bratanov
Telerik team
SK
Top achievements
Rank 1
Peter
Top achievements
Rank 1
Josh
Top achievements
Rank 1
Veteran
JP
Top achievements
Rank 2
Share this question
or