Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERROR Compile Leaflet.EasyButton in Typescript #93

Open
faienz93 opened this issue Sep 11, 2019 · 3 comments
Open

ERROR Compile Leaflet.EasyButton in Typescript #93

faienz93 opened this issue Sep 11, 2019 · 3 comments

Comments

@faienz93
Copy link

Hi,

i have imported Easy-Button for my project. When i want compile my Angular Project I obtain this error:

ERROR in node_modules/leaflet-easybutton/src/easy-button.d.ts(4,16): error TS2665: Invalid module name in augmentation. Module 'leaflet' resolves to an untyped module at 'Path/node_modules/leaflet/dist/leaflet-src.js', which cannot be augmented.

Leaflet: "^1.5.1",
Leaflet-Easy.Button: "^2.4.0",
Angular CLI: "~7.3.7",
Typescript: "~3.2.2"
Visual Studio Code: 1.38.0

@faienz93 faienz93 changed the title ERROR in node_modules/leaflet-easybutton/src/easy-button.d.ts(4,16): error TS2665: Invalid module name in augmentation. Module 'leaflet' resolves to an untyped module at 'PATH/node_modules/leaflet/dist/leaflet-src.js', which cannot be augmented. ERROR Compile Leaflet.EasyButton in Typescript Sep 11, 2019
@faienz93
Copy link
Author

I temporarily fixed the error renaming leaflet to leaflet-easybutton the declaration in the file easy-leaflet.d.ts

@josesaranda
Copy link

Could you reproduce what happens? (i.e with codebox)

I did this and it works for me:

import 'leaflet-easybutton';
import 'leaflet-easybutton/src/easy-button.css';

@mikila85
Copy link

This should fix the problem:
yarn add @types/leaflet

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants