obsidian-dataview: [BUG]: Broken API (0.5.58 → 0.5.64) : ERROR TS2307 - Cannot find module 'xxx' or its corresponding type declarations

What happened?

When updating in my own plugin the dataview package to 0.5.59, TS can’t found any declaration for Obsidian-dataview.

image

Translation:

Try npm i --save-dev @types/obsidian-dataview if it exists or add a new declaration (.d.ts) file containing `declare module ‘obsidian-dataview’; ERROR TS7016 Could not find a declaration file for module 'obsidian-dataview" […]

Spotted that the two last version doesn’t have the main.d.ts file:

Comparison to 0.5.56, where libs contains everything.

DQL

/

JS

No response

Dataview Version

0.5.58 - 0.5.56

Obsidian Version

Not relevant

OS

Windows

About this issue

  • Original URL
  • State: open
  • Created 3 years ago
  • Comments: 16 (2 by maintainers)

Most upvoted comments

I’ve got some workarounds

tsconfig.json

{
  "compilerOptions": {
    "paths": {
      "*": [
        "./node_modules/obsidian-dataview/lib/*"
      ]
    }
}

Regarding LocalForage issue, it’s solved by adding somewhere in your code

import "localforage";