Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

86
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!