node_modules/react-leaflet/lib/LayersControl.d.ts:9:65 - error TS2307: Cannot find module '@react-leaflet/core/lib/context' or its corresponding type declarations.
9 layerContainer?: import("leaflet").LayerGroup<any> | import("@react-leaflet/core/lib/context").ControlledLayer | undefined;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
node_modules/react-leaflet/lib/LayersControl.d.ts:18:69 - error TS2307: Cannot find module '@react-leaflet/core/lib/context' or its corresponding type declarations.
18 layerContainer?: import("leaflet").LayerGroup<any> | import("@react-leaflet/core/lib/context").ControlledLayer | undefined;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
node_modules/react-leaflet/lib/LayersControl.d.ts:30:69 - error TS2307: Cannot find module '@react-leaflet/core/lib/context' or its corresponding type declarations.
30 layerContainer?: import("leaflet").LayerGroup<any> | import("@react-leaflet/core/lib/context").ControlledLayer | undefined;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
node_modules/react-leaflet/lib/SVGOverlay.d.ts:11:65 - error TS2307: Cannot find module '@react-leaflet/core/lib/context' or its corresponding type declarations.
11 layerContainer?: import("leaflet").LayerGroup<any> | import("@react-leaflet/core/lib/context").ControlledLayer | undefined;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Found 4 errors in 2 files.
Errors Files
3 node_modules/react-leaflet/lib/LayersControl.d.ts:9
1 node_modules/react-leaflet/lib/SVGOverlay.d.ts:11
Steps to reproduce
I've made a minimal repro: https://github.com/40thieves/ts-react-leaflet which installs the relevant dependencies and configures tsconfig.json with the module: preserve setting. To reproduce, you need to:
Clone & npm install
Run npm run check
(apologies, I'm not sure StackBlitz would work as it's related to running tsc)
Bug report in v4
I'm running
tsc
with thepreserve
value for themodule
setting intsconfig.json
on a project with React Leaflet.Expected behavior
No tsc errors are found.
Actual behavior
tsc throws the following errors:
Steps to reproduce
I've made a minimal repro: https://github.com/40thieves/ts-react-leaflet which installs the relevant dependencies and configures
tsconfig.json
with themodule: preserve
setting. To reproduce, you need to:npm install
npm run check
(apologies, I'm not sure StackBlitz would work as it's related to running tsc)