简体   繁体   中英

Runtime Error: error TS2307: Cannot find module 'leaflet'

I have problem with leaflet dictionary. I saw similar problems on stackoverflow, but it has not been resolved. I reinstalled leaflet and types, but there is still a problem. When I import L from leaflet, i have this problem

I installed leaflet like that npm install leaflet and npm install @types/leaflet

This is line of code where i have problem

import * as L from 'leaflet'

您应该import L from 'leaflet'使用import L from 'leaflet' :)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM