Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

434
Views
Error intermitente de Blazor JSInterop: no se pudo encontrar ''

De vez en cuando, cuando cargo mi página, aparece este error, que impide que mi página funcione. Es raro que pueda cargar la página, 3 o 4 veces y todo está bien, pero cuando intento actualizar mi página rápidamente sucesion me sale este error..

STACK - Microsoft.JSInterop.JSException: No se pudo encontrar 'buscar' ('buscar' no estaba definido). Error: No se pudo encontrar 'buscar' ('buscar' no estaba definido). en http://localhost:26661/_framework/blazor.server.js:1:67390 en Array.forEach () en e.findFunction (http://localhost:26661/_framework/blazor.server.js:1:67350 ) en v (http://localhost:26661/_framework/blazor.server.js:1:69092) en http://localhost:26661/_framework/blazor.server.js:1:70038 en new Promise () en e.beginInvokeJSFromDotNet (http://localhost:26661/_framework/blazor.server.js:1:70011) en http://localhost:26661/_framework/blazor.server.js:1:26293 en Array.forEach () en e.invokeClientMethod (http://localhost:26661/_framework/blazor.server.js:1:26263) en Microsoft.JSInterop.JSRuntime.InvokeAsync[TValue](Int64 targetInstanceId, identificador de cadena, Object[] args) en Microsoft .JSInterop.JSRuntimeExtensions.InvokeVoidAsync(IJSRuntime jsRuntime, identificador de cadena, objeto[] argumentos) en

Llamada de interoperabilidad -

 protected override async Task OnAfterRenderAsync(bool firstRender) { try { await Js.InvokeVoidAsync("search"); } catch (Exception e) { ErrorIsHidden = false; ErrorDescription = e.ToString(); //Show error description on page StateHasChanged(); throw; } }

JS-

 function search(){$(document).ready(function () { $("#myInput").on("keyup", function () { var value = $(this).val().toLowerCase(); $('div[data-role="apps"]').filter(function () { $(this).toggle($(this).text().toLowerCase().indexOf(value) > -1) }); }); });}

PD: también pensé que try-catch permitiría que el programa siguiera funcionando (obviamente) sin la función de búsqueda en este caso.

SOBRE PRUEBAS ADICIONALES

Claramente, esto no está bien, pero lo tonto es que si vuelvo a agregar la llamada JS a la captura, el JS realmente se carga ... aparece mi error, pero la aplicación aún falla, pero el JS funciona (obviamente porque el error ha sido registrada para entonces).

Extraño... No estoy seguro de cuál es el problema aquí.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!