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

Could not find a declaration file for module '@vueuse/sound' #42

Open
RaffaeleSgarro opened this issue Aug 12, 2023 · 2 comments · May be fixed by #43
Open

Could not find a declaration file for module '@vueuse/sound' #42

RaffaeleSgarro opened this issue Aug 12, 2023 · 2 comments · May be fixed by #43

Comments

@RaffaeleSgarro
Copy link

RaffaeleSgarro commented Aug 12, 2023

I have the following compilation error when running npm run build in a fresh Vue app:

src/App.vue:21:26 - error TS7016: Could not find a declaration file for module '@vueuse/sound'. 'C:/[...redacted...]/node_modules/@vueuse/sound/dist/index.mjs' implicitly has an 'any' type.
  There are types at 'C:/[...redacted...]/node_modules/@vueuse/sound/dist/index.d.ts', but this result could not be resolved when respecting package.json "exports". The '@vueuse/sound' library may need to update its package.json or typings.

21 import { useSound } from '@vueuse/sound';
                            ~~~~~~~~~~~~~~~


Found 1 error in src/App.vue:21

ERROR: "type-check" exited with 2.

The error goes away if I manually delete the exports key in package.json:

  "exports": {
    ".": {
      "require": "./dist/index.cjs",
      "import": "./dist/index.mjs"
    },
    "./nuxt": {
      "require": "./dist/nuxt.cjs",
      "import": "./dist/nuxt.mjs"
    }
  },

Do you have any clue to solve it?

@RaffaeleSgarro RaffaeleSgarro linked a pull request Aug 13, 2023 that will close this issue
@RaffaeleSgarro
Copy link
Author

If it works for you it's a valid workaround. Otherwise I published a forked build:

https://www.npmjs.com/package/@raffaelesgarro/vue-use-sound

@oliver139
Copy link

Oops, mine is not working and thanks for your build!

galexrt added a commit to fivenet-app/fivenet that referenced this issue Feb 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants