I have installed openlayers to my angular 12 project.
npm install ol
and
npm install --save @types/ol
But when I import in home component:
import Map from 'ol/Map';
throws exception:
Error: node_modules/ol/ImageBase.d.ts:32:48 - error TS2694:
Namespace '"C:/Dev/my-app/node_modules/ol/ImageState"' has no exported
member 'default'.
protected state: import("./ImageState.js").default;
protected state: import("./TileState.js").default;
protected layout: import("./GeometryLayout.js").default;
One solution is updating tsconfig.json.
In tsconfig.json file at the compilerOptions object add "skipLibCheck": true.
This will resolve the issue.