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

88
Vistas
Error: export 'Draw' (imported as 'L') was not found in 'leaflet'

These are my packages:

"@types/leaflet": "^1.8.0",
"@types/leaflet-draw": "^1.0.5",
"leaflet-canvas-markers": "^1.0.7",
"leaflet": "^1.9.1",
"leaflet-draw": "^1.0.4",

These are my imports a the top of my Angular service file:

import * as L from 'leaflet';
import 'leaflet-canvas-markers';
import 'leaflet-draw';

In Angular 13 (Typescript 4.6.4) it was ok, but now I'm moving to Angular 14 (Typescript 4.7.4) and I'm getting this error:

Error: export 'Draw' (imported as 'L') was not found in 'leaflet' (possible exports: ...)

I've got the same behavior with "canvasMarker" npm library.

Error: export 'canvasMarker' (imported as 'L') was not found in 'leaflet' (possible exports: ...)

The code that raise the error within my Angular service is:

const leafletDrawPolyline = new L.Draw.Polyline(map, options);

After reading this, I tried in the following without success:

const leafletDrawPolyline = new (L.Draw as any).Polyline(map, options);

I understand it's a kind of import issue at Typescript level, but I don't know how to solve. Any suggestion?

almost 4 years ago · Santiago Trujillo
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