Dealing with jQuery when running the app on server #1497

Closed
opened 2025-08-09 17:20:22 +00:00 by fergalmoran · 0 comments
Owner

Originally created by @felipedrumond on 7/20/2016

I'm having the issue below when running at server my app that uses jQuery. I'm aware that using jQuery is not recommended but at this point, I need to make use of it for a while.

[Node] WARNING: your application is taking a long time to render the application
[Node]
fail: Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware[0]
An unhandled exception has occurred while executing the request
System.Threading.Tasks.TaskCanceledException: A task was canceled.
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult()
at System.Net.Http.HttpClient.d__58.MoveNext()

and the html result is

An unhandled exception occurred while processing the request.

    <div class="titleerror">TaskCanceledException: A task was canceled.</div>
    <p class="location">ThrowForNonSuccess</p>

As a workaround I can check with if (typeof (document) == 'undefined') or even with ngUniversal.isNode to skip the code that uses jQuery, but I was wondering if there is a better, transparent solution for this. I believe that there should be a configuration at the server to ignore jQuery.

*Originally created by @felipedrumond on 7/20/2016* I'm having the issue below when running at server my app that uses jQuery. I'm aware that using jQuery is not recommended but at this point, I need to make use of it for a while. [Node] WARNING: your application is taking a long time to render the application [Node] fail: Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware[0] An unhandled exception has occurred while executing the request System.Threading.Tasks.TaskCanceledException: A task was canceled. at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult() at System.Net.Http.HttpClient.<FinishSendAsync>d__58.MoveNext() and the html result is <h1>An unhandled exception occurred while processing the request.</h1> ``` <div class="titleerror">TaskCanceledException: A task was canceled.</div> <p class="location">ThrowForNonSuccess</p> ``` As a workaround I can check with `if (typeof (document) == 'undefined')` or even with ngUniversal.isNode to skip the code that uses jQuery, but I was wondering if there is a better, transparent solution for this. I believe that there should be a configuration at the server to ignore jQuery.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/JavaScriptServices#1497
No description provided.