-
-
Notifications
You must be signed in to change notification settings - Fork 410
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG]: Broken API (0.5.58 → 0.5.64) : ERROR TS2307 - Cannot find module 'xxx' or its corresponding type declarations #2080
Comments
Updating to 0.5.60 should help, but now, any import lead to "any" and opening the index.d.ts & other files leads to that : Error (TS2307) My tsconfig: {
"compilerOptions": {
"baseUrl": "./",
"inlineSourceMap": true,
"inlineSources": true,
"module": "ESNext",
"target": "ES6",
"allowJs": true,
"noImplicitAny": true,
"moduleResolution": "node",
"importHelpers": true,
"isolatedModules": true,
"resolveJsonModule": true,
"strict":true,
"lib": [
"DOM",
"ES5",
"ES6",
"ES7",
"ES2021",
"ES2022"
],
},
"include": [
"**/*.ts"
]
} |
Bug remains in |
Remains in |
I'm having the same issue. I did a fresh clone of the obsidian-sample-plugin repo and followed the instruction for adding the dataview api to the plugin and getting the same problems listed above. |
As @Lisandra-dev pointed out this was broken after 0.5.56. From what I can see, in the following release, a dependency on ttypescript was removed and a misconfiguration in the rollup.config.js caused types to go missing (#2073) for few releases until it was fixed in 0.5.60 (#2074). However, from 0.5.60 and onwards the imports in the generated d.ts files are no longer relative paths, causing module resolution to fail resulting in importing those types as Note the difference between the imports in index.d.ts (0.5.56) vs index.d.ts (0.5.60). As a temporary workaround I manually edited the imports in the d.ts files in node_modules to use relative imports and that resolved the issue. Of course this will revert to the error when you wipe node_modules or do a clean install. I don't know what a real fix to this would be. I'm assuming the removal of ttypescript had something to do with it but I'm not familiar with that package. Perhaps setting paths in |
My methods to fix this on my side: |
I needed to make additional paths beyond the above but now I'm down to an error about LocalForage. I'm just trying to use in node, not an obsidian plugin. |
Any update…? |
I've got some workarounds
{
"compilerOptions": {
"paths": {
"*": [
"./node_modules/obsidian-dataview/lib/*"
]
}
} Regarding import "localforage"; |
What happened?
When updating in my own plugin the dataview package to 0.5.59, TS can't found any declaration for Obsidian-dataview.
Translation:
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
The text was updated successfully, but these errors were encountered: