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

131
Vistas
Blazor Webassembly multiple exports in single JS file returns error when minimized

I am trying to add get and set blazor culture as advised in the Microsoft Documentation. According to the documentation, i can put the get and set Blazorculture in a single JS with 2 exports like below

The preceding example pollutes the client with global methods. For a better approach in production apps, see JavaScript isolation in

JavaScript modules.

Example:

JavaScript

 
export function getBlazorCulture() {
  return window.localStorage['BlazorCulture'];
};
export function setBlazorCulture(value) {
  window.localStorage['BlazorCulture'] = value;
};
If you use the preceding functions, change the JS interop calls in this section from blazorCulture.get to getBlazorCulture and from

blazorCulture.set to setBlazorCulture.

So i created a single Js file as below, i have tried using export on both function and as well as like using exports as below but error didnt go away.

export function getBlazorCulture() {
  return window.localStorage['BlazorCulture'];
};
export function setBlazorCulture(value) {
  window.localStorage['BlazorCulture'] = value;
};



function getBlazorCulture() {
    return window.localStorage['BlazorCulture'];
};

function setBlazorCulture(value) {
    window.localStorage['BlazorCulture'] = value;
};
exports {getBlazorCulture,setBlazorCulture}

that seems to be working fine but once I minimize this min.js, I am getting error message as

enter image description here

minimized js looks like

"use strict";function getBlazorCulture(){return window.localStorage.BlazorCulture}function setBlazorCulture(n){window.localStorage.BlazorCulture=n}Object.defineProperty(exports,"__esModule",{value:!0});exports.getBlazorCulture=getBlazorCulture;exports.setBlazorCulture=setBlazorCulture;

using on separate Js files, no error.

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