Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

92
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda