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

143
Vistas
System is not defined with dynamic import in angular 13

I have below code for dynamic load the locales

declare var System;
let angularLocale = convertAbpLocaleToAngularLocale(abp.localization.currentLanguage.name);
        System.import(`@angular/common/locales/${angularLocale}.js`)
            .then(module => {
                registerLocaleData(module.default);
                NgxBootstrapDatePickerConfigService.registerNgxBootstrapDatePickerLocales().then(_ => {
                    resolve(true);
                    abp.ui.clearBusy();
                });
            }, reject);

If I don't use the System the build command throws an exception as

Module not found: Error: Package path ./locales is not exported from package ....\node_modules\@angular\common (see exports field in .....\node_modules\@angular\common\package.json)

If I use the System I get an exception in the browser console as

core.mjs:6495 
        
       ERROR Error: Uncaught (in promise): ReferenceError: System is not defined
ReferenceError: System is not defined
    at registerLocales (root.module.ts:193)
    at root.module.ts:64
    at ZoneDelegate.invoke (zone.js:400)
    at Object.onInvoke (core.mjs:25877)
    at ZoneDelegate.invoke (zone.js:399)
    at Zone.run (zone.js:160)
    at zone.js:1318
    at ZoneDelegate.invokeTask (zone.js:434)
    at Object.onInvokeTask (core.mjs:25864)
    at ZoneDelegate.invokeTask (zone.js:433)
    at resolvePromise (zone.js:1255)
    at zone.js:1325
    at ZoneDelegate.invokeTask (zone.js:434)
    at Object.onInvokeTask (core.mjs:25864)
    at ZoneDelegate.invokeTask (zone.js:433)
    at Zone.runTask (zone.js:205)
    at drainMicroTaskQueue (zone.js:620)
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

I had the same problem with "Module not found". In the application we use i18n. Now I get the the country from the i18n, and then set the locale to the pipe, witch holds this information. So I do not need the dynamic Modul loading anymore. Maybe that helps you?

about 4 years ago · Juan Pablo Isaza Denunciar
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