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

138
Vistas
Importing Plotly module to Angular breaks application

I have used npm to install angular-plotly.js according to its documentation (https://github.com/plotly/angular-plotly.js/blob/master/README.md) as follows:

npm install angular-plotly.js plotly.js-dist-min --save
npm install @types/plotly.js-dist-min --save-dev

When I go into my main app component, I include the following code:

import { NgModule } from '@angular/core';
...
import * as PlotlyJS from 'plotly.js-dist-min';
import { PlotlyModule } from 'angular-plotly.js';

PlotlyModule.plotlyjs = PlotlyJS;

@NgModule({
  declarations: [
    AppComponent,
    ...
  ],
  imports: [
    ...,
    PlotlyModule
  ],
  providers: [
    ...
  ],
  bootstrap: [AppComponent],
})

export class AppModule { }

Now, when I ng serve --open my app (which is Angular 13.x), I get the following errors:

core.mjs:4032 JIT compilation failed for NgModule class AppModule {
}
getCompilerFacade @ core.mjs:4032
get @ core.mjs:23727
getNgModuleDef @ core.mjs:1128
assertNgModuleType @ core.mjs:1297
compileNgModuleFactory @ core.mjs:25796
bootstrapModule @ core.mjs:26047
14431 @ main.ts:11
__webpack_require__ @ bootstrap:19
__webpack_exec__ @ main.ts:12
(anonymous) @ main.ts:12
__webpack_require__.O @ chunk loaded:23
(anonymous) @ main.ts:12
webpackJsonpCallback @ jsonp chunk loading:71
(anonymous) @ main.js:2
core.mjs:4051 Uncaught Error: The NgModule 'AppModule' needs to be compiled using the JIT compiler, but '@angular/compiler' is not available.

JIT compilation is discouraged for production use-cases! Consider using AOT mode instead.
Alternatively, the JIT compiler should be loaded by bootstrapping using '@angular/platform-browser-dynamic' or '@angular/platform-server',
or manually provide the compiler with 'import "@angular/compiler";' before bootstrapping.
    at getCompilerFacade (core.mjs:4051:1)
    at AppModule.get (core.mjs:23727:1)
    at getNgModuleDef (core.mjs:1128:1)
    at assertNgModuleType (core.mjs:1297:1)
    at compileNgModuleFactory (core.mjs:25796:1)
    at PlatformRef.bootstrapModule (core.mjs:26047:1)
    at 14431 (main.ts:11:26)
    at __webpack_require__ (bootstrap:19:1)
    at __webpack_exec__ (main.ts:12:37)
    at main.ts:12:37

Thus far I have been able to successfully troubleshoot this issue. Does anyone know how to resolve this?

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