Closed luxterful closed 11 months ago
Hi @luxterful, in any of my setups, types can be imported correctly. But I trust that you're having issues. This is because the types import is missing in the package.json exports field, which is where your tsconfig is looking for.
I'm about to release a new version that adds those types also in the exports field, and you should be able to import them.
WOW! Many thanks for the superfast reply and fix! Amazing
@luxterful, in the meanwhile, could you please share with me your tsconfig.json? Thanks.
Ok. So my setup is a npm monorepo.
Here are the tsconfig files
{
"files": [],
"references": [
{
"path": "./tsconfig.node.json"
},
{
"path": "./tsconfig.app.json"
},
{
"path": "./tsconfig.vitest.json"
}
]
}
{
"extends": "@tsconfig/node18/tsconfig.json",
"include": ["vite.config.*", "vitest.config.*", "cypress.config.*"],
"compilerOptions": {
"composite": true,
"module": "ESNext",
"types": ["node"]
}
}
{
"extends": "@vue/tsconfig/tsconfig.dom.json",
"include": [
"env.d.ts",
".env",
"src/**/*",
"src/**/*.vue",
"src/**/*.json",
],
"exclude": [
"src/**/__tests__/*"
],
"compilerOptions": {
"composite": true,
"types": [
"node",
"vite/client"
],
"baseUrl": ".",
"paths": {
"@/*": [
"./src/*"
],
}
}
}
Thank you @luxterful, I just released Notivue 1.1.4. Install it with:
npm i notivue@latest
I've also created a working example on StackBlitz with your same tsconfig and the new version installed.
Feel free to close the issue if everything is working as expected.
Amazing! Thx for the fix!
I have installed the library and tried to use it in the
main.ts
.But i get a typescript issue: