fatihsolhan / v-onboarding

v-onboarding is a super-slim, fully-typed onboarding component for Vue 3
https://v-onboarding.fatihsolhan.com/
MIT License
164 stars 20 forks source link

Could not find a declaration file for module 'v-onboarding' #95

Closed joshkrz closed 3 months ago

joshkrz commented 4 months ago

Describe the bug Types are not available when using the library. Running a build errors out with:

error TS7016: Could not find a declaration file for module 'v-onboarding'. './node_modules/v-onboarding/dist/v-onboarding.es.js' implicitly has an 'any' type.

There are types at './node_modules/v-onboarding/src/typings.d.ts', but this result could not be resolved when respecting package.json "exports". The 'v-onboarding' library may need to update its package.json or typings.

1 import { VOnboardingWrapperOptions } from 'v-onboarding';

To Reproduce Steps to reproduce the behavior:

  1. Import v-onboarding and use as normal
  2. Run a build
  3. Observe typescript errors

Expected behavior Types be exported from the library and for TS to detect them and build successfully.

Versions

TS Config

{
  "compilerOptions": {
    "target": "ES2020",
    "useDefineForClassFields": true,
    "module": "ESNext",
    "lib": ["ES2020", "DOM", "DOM.Iterable"],
    "skipLibCheck": true,

    /* Bundler mode */
    "moduleResolution": "bundler",
    "allowImportingTsExtensions": true,
    "resolveJsonModule": true,
    "isolatedModules": true,
    "noEmit": true,
    "jsx": "preserve",

    /* Linting */
    "strict": true,
    "noUnusedLocals": false,
    "noUnusedParameters": false,
    "noFallthroughCasesInSwitch": true
  },
  "include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue"],
  "references": [{ "path": "./tsconfig.node.json" }],
}
armenr commented 4 months ago

We've got the same issue...

fatihsolhan commented 4 months ago

Hey everyone, sorry for this bug. I'll take a look at it as soon as possible.

armenr commented 4 months ago

VSCode says this, in case it's at all helpful:

Could not find a declaration file for module 'v-onboarding'.

'<PROJECT_PATH>/node_modules/.pnpm/v-onboarding@2.8.0_vue@3.4.21/node_modules/v-onboarding/dist/v-onboarding.es.js' implicitly has an 'any' type.

There are types at '<PROJECT_PATH>/node_modules/v-onboarding/src/typings.d.ts', but this result could not be resolved when respecting package.json "exports". 

The 'v-onboarding' library may need to update its package.json or typings.

Sağ ol @fatihsolhan

github-actions[bot] commented 3 months ago

:tada: This issue has been resolved in version 2.8.1 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

fatihsolhan commented 3 months ago

Hey everyone, this should be fixed now. Feel free to reopen if the issue persists