Skip to content

Point to TS types#21

Merged
k-yle merged 1 commit into
osmlab:mainfrom
dabreegster:fix_types
May 19, 2025
Merged

Point to TS types#21
k-yle merged 1 commit into
osmlab:mainfrom
dabreegster:fix_types

Conversation

@dabreegster
Copy link
Copy Markdown
Contributor

Hi, I'm getting this error:

Error: Could not find a declaration file for module 'osm-api'. '/home/dabreegster/speedwalk/web/node_modules/osm-api/dist/index.js' implicitly has an 'any' type.
  Try `npm i --save-dev @types/osm-api` if it exists or add a new declaration (.d.ts) file containing `declare module 'osm-api';` (ts)
<script lang="ts">
  import * as OSM from "osm-api";

If I make this fix locally in my node_modules, then the errors go away (and I can verify the TS declarations are working, by incorrectly using the library).

Thanks so much for this package; it's going to save me loads of hassle!

@k-yle
Copy link
Copy Markdown
Member

k-yle commented May 19, 2025

thanks for the PR!

Looks like this bug was introduced in 36a5b33, because we started importing package.json which is outside the src folder, but we didn't explicitly set "rootDir": "src" in the tsconfig... 😬

@k-yle k-yle merged commit b66b2af into osmlab:main May 19, 2025
3 checks passed
@k-yle
Copy link
Copy Markdown
Member

k-yle commented May 19, 2025

released in v2.6.1, thanks again

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

Successfully merging this pull request may close these issues.

2 participants