Skip to content
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

Typescript declaration problem ts(7016) #91

Open
2 tasks done
gmqiyue opened this issue Jun 3, 2023 · 1 comment
Open
2 tasks done

Typescript declaration problem ts(7016) #91

gmqiyue opened this issue Jun 3, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@gmqiyue
Copy link

gmqiyue commented Jun 3, 2023

Checks

Version

0.6.12

Description

I have created a Vue3+TS project, and when I tried to use the @splidejs/vue-splide module in the project, I encountered the following error:

Could not find a declaration file for module '@splidejs/vue-splide'. '/project_root/node_modules/.pnpm/@Splidejs[email protected]/node_modules/@splidejs/vue-splide/dist/js/vue-splide.esm.js' implicitly has an 'any' type.
There are types at '/project_root/node_modules/@splidejs/vue-splide/src/js/index.ts', but this result could not be resolved when respecting package.json "exports". The '@splidejs/vue-splide' library may need to update its package.json or typings.ts(7016)

I referred to the package.json configuration of @splidejs/splide, and it seems to be an issue with the exports field. Here are the details:

"exports": {
    ".": {
      "require": "./dist/js/vue-splide.cjs.js",
      "import": "./dist/js/vue-splide.esm.js",
      "default": "./dist/js/vue-splide.esm.js"
    },
    "./css": "./dist/css/splide.min.css",
    "./css/core": "./dist/css/splide-core.min.css",
    "./css/*": "./dist/css/themes/splide-*.min.css"
  }

The current version of exports does not include the types field in the default export. If possible, I will submit a pull request to address this issue.

Reproduction Link

No response

Steps to Reproduce

  1. Create Vue 3 Typescript project
  2. Install @splidejs/vue-splide
  3. Setup component containing Splide and SplideSlide

Expected Behaviour

Without TypeError.

@gmqiyue gmqiyue added the bug Something isn't working label Jun 3, 2023
@mojjjtaba
Copy link

same error here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants