Angular 13: Unable to build Cannot find namespace 'TopoJSON'
See original GitHub issueWhen trying to build a project with ng serve I get the following errors
Error: node_modules/@unovis/angular/dist/lib/components/topojson-map/topojson-map.component.d.ts:56:16 - error TS2503: Cannot find namespace 'TopoJSON'.
56 topojson?: TopoJSON.Topology;
~~~~~~~~
Error: node_modules/@unovis/ts/components/topojson-map/config.d.ts:9:16 - error TS2503: Cannot find namespace 'TopoJSON'.
9 topojson?: TopoJSON.Topology;
~~~~~~~~
I’ve added TopoJSON to my package.json but the issue persists. I’ve added the following packages:
"@types/topojson-specification": "^1.0.2",
"topojson": "^3.0.2",
"topojson-client": "^3.1.0",
However, updating the types in the files to Any fixes the issue. Or just importing TopoJSON into the file explicitly.
Is there something I’m missing in setting up the package? I figure that my tsconfig setup can also be the issue but just wanted to check if you guys have seen this before
Had one more error that was fixed by adding @types/lodash
Error: node_modules/@unovis/ts/core/component/index.d.ts:1:23 - error TS2688: Cannot find type definition file for 'lodash'.
1 /// <reference types="lodash" />
~~~~~~
Issue Analytics
- State:
- Created 9 months ago
- Comments:10 (5 by maintainers)
Top Results From Across the Web
maplibre v2.0.0 typings angular 13 · Issue #776 - GitHub
I now see this too in my project. As a workaround, you can set skipLibCheck: true in tsconfig.json file. In order to truly...
Read more >Cannot find namespace 'MyApp' after Angular and Typescript ...
I have a type definition file where all dto objects for my app are exposed to global scope. DtosGenerator.d.ts declare module MyApp.Rest.
Read more >@types/geojson - npm
Start using @types/geojson in your project by running `npm i ... There are 370 other projects in the npm registry using @types/geojson.
Read more >angular/angular-cli - Gitter
I tried resolving by reading up on SO, and they've recommended to add some paths to angular-cli.json, but I can't find it on...
Read more >Cannot find namespace 'WebMidi' in Angular - CircleCI Discuss
What I've done: added "types": ["WebMidi"] under "compilerOptions" in all of my ts configuration files including tests.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

@AhmedHalat Great and thanks for writing about your fix!
When you explicitly set
typesin your tsconfig, only those types will be visible to the compiler. That’s why you had to add"topojson-client"there explicitly. Here is an excerpt from TSConfig docs:We’ll add a few words about it to our docs too.
@AhmedHalat Ok, I’ll need to look deeper into the issue. I’ll keep you posted!