Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

392
Vistas
Microsoft.JSInterop.JSException: no se pudo encontrar 'browserInterop.getPropertyRef' ('browserInterop' no estaba definido) - en Blazor

Tengo un problema en mi aplicación blazor con JS Interop. El método es para una ventana emergente que permite acceder a la ubicación de los usuarios para una llamada a la API meteorológica, pero si es la primera vez que los usuarios acceden al sitio, se bloquea... pero si se actualiza, todo funciona bien y si los usuarios existen, también funciona bien aquí. es el método y se llama. Agradecería cualquier entrada.

Método:

 public async Task GetUserLocation() { try { //Ask user access to geolocation var window = await jsRuntime.Window(); var navigator = await window.Navigator(); GeolocationWrapper = navigator.Geolocation; } catch (Exception) { throw; } //Gets current Geolocation CurrentPosition = await GeolocationWrapper.GetCurrentPosition(); //Lattitude coords UserLocaion.Lat = CurrentPosition.Location.Coords.Latitude.ToString("0.00"); //Longitude coords UserLocaion.Lon = CurrentPosition.Location.Coords.Longitude.ToString("0.00"); }

llamado aquí:

 protected override async Task OnAfterRenderAsync(bool firstRender) { if (firstRender) { // Gets coordinates from geolocation using IJSRuntime Geoloaction navigator await GetUserLocation(); //Gets data from Open Weather API OPW_WeatherData = await iOPW.GetWeatherData(UserLocaion.Lat,UserLocaion.Lon); //Gets the forecast for the week WeeksForecast = iOPW.GetWeeksForecast(OPW_WeatherData); //Get todays weather TodaysWeather = iOPW.GetTodaysWeather(OPW_WeatherData, WeeksForecast); //Sets the Timezone of the current User TimeZone = OPW_WeatherData.Timezone; StateHasChanged(); } }
about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda