Closed TechSupportJosh closed 2 years ago
Maybe just declare module in your d.ts file ? like "declare module 'vue3-treeview';" ?
This works, but means there are no types available for the project, which is unfortunate
On Wed, 22 Dec 2021, 18:57 N00ts, @.***> wrote:
Maybe just declare module in your d.ts file ? like "declare module 'vue3-treeview';" ?
— Reply to this email directly, view it on GitHub https://github.com/N00ts/vue3-treeview/issues/10#issuecomment-999795843, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABHTJODZOTIXG7YUUIOD3Q3USINSNANCNFSM5KNPAXHQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.
You are receiving this because you authored the thread.Message ID: @.***>
It should, the project is exported with all types, go check dist folder
I can see the .d.ts. files are there, however they aren't correctly exposed (not exactly sure why). For example, the index.d.ts file attempts to import from the /src/components directory, which does not exist in the dist folder:
index.d.ts
import Tree from './components/Tree.vue';
export default Tree;
This results in the error:
Cannot find module './components/Tree.vue' or its corresponding type declarations.ts(2307)
It should compile with this in your declaration file:
declare module "vue3-treeview" {
type Tree = object;
export = Tree
}
I'm getting the following error when doing
import Tree from "vue3-treeview"
:Reproduction steps:
Then change the
App.vue
file to the following content:Then build with
npm run build
:I've included a repository with the code as well as a sandbox to view the error with: https://codesandbox.io/s/rough-cache-kg9iw?file=/src/App.vue https://github.com/TechSupportJosh/vue3-treeview-bug