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

Fix HowlConstructor.value is not a constructor error #29

Merged
merged 2 commits into from
Feb 2, 2023

Conversation

P-James
Copy link
Contributor

@P-James P-James commented Nov 29, 2022

I had to make 2 changes to get the package working in a fresh Vite CLI app (vue 3).

  1. Change the HowlConstructor
    2a. Either import onMounted from 'vue' instead of 'vue-demi' (as mentioned here Not working with Vue3 & Vite3 #27 (comment))
    2b. Or add the vite config option to disable pre-bundling of vue-demi in my own app.

I thought 2b was the better option.

Only tested on a Vite CLI app.

@ThimoDEV
Copy link

ThimoDEV commented Dec 5, 2022

Do you know if this also fixes the same error for nuxt 3 with auto importing and constructor? I think they are related issues.

@P-James
Copy link
Contributor Author

P-James commented Dec 5, 2022

Sorry I have not used nuxt so can't say for sure.
In my own project I have just copied the code to a local directory as a workaround.
Interestingly, I don't need to use howler.default.Howl any more, I can just use howler.Howl.
It still need to import onMounted from vue.
I tried installing vue-demi locally and it didn't work.

@kissu
Copy link

kissu commented Dec 6, 2022

I'm not using vue-demi anywhere in my app.

Simply importing those

import { computed, shallowRef, ref, watch, onMounted, nextTick } from 'vue'
import { useSound } from '@vueuse/sound'

I've tried

export default defineConfig({
  optimizeDeps: {
    exclude: ['@vueuse/sound'],
  },
})

but no success so far.

image

Not sure if your PR will fix the issue here.

Nothing really fancy configuration-wise.

Vue 3.2
Vite 3.2.5
@vueuse/sound 2.0.0

@P-James
Copy link
Contributor Author

P-James commented Dec 6, 2022

@kissu did you try

export default defineConfig({
  optimizeDeps: {
    exclude: ['vue-demi'],
  },
})

?
It worked for me even when I didn't have it in my package.json.
I think vite knows it's a peer dependency.

Also I generally recognise that this PR is not ideal. It sounds like vue-demi needs to be updated but that's beyond my expertise

@Baiyuetribe
Copy link

image
same issue, vue^3.2.45+vite^4.0.0

@AtlasApollo
Copy link

Please merge, thank you.

@AtlasApollo
Copy link

Please merge, thank you.

+1

@kissu
Copy link

kissu commented Jan 10, 2023

No point into spamming tbh. @AtlasApollo @SuzyWeightman

@AtlasApollo
Copy link

No point into spamming tbh. @AtlasApollo @SuzyWeightman

You're right, I apologize for that.

@dev-charles15531
Copy link

dev-charles15531 commented Jan 19, 2023

@P-James This issue gets resolved from your default.Howl fix. I'm just surprised the merge is been neglected and the issue still open

@Koaieus
Copy link

Koaieus commented Jan 24, 2023

Will this PR fix this error or not? If it does, I'd like to kindly request that this PR gets merged; thanks in advance :)

@dev-charles15531
Copy link

Yes!
The PR does fix the issue.

@Tahul Tahul merged commit 31ae87f into vueuse:main Feb 2, 2023
@Tahul
Copy link
Member

Tahul commented Feb 2, 2023

Hello here :)

Sorry for late answer, a bit overwhelmed lately, preparing conferences!

Happy to get your feedbacks if this fixes all of your issues. @kissu @P-James @Koaieus

@ThimoDEV ; could you let me know what is that issue with Nuxt 3 exactly?

The demo website does run on Nuxt and I have no types problems there.

@Q16solver
Copy link

@Tahul I believe it's related to this issue #30, the reason that the demo website runs fine might be because it is not using vueuse/sound as a package, but importing the module directly from the src repo so it is able to find the file, whereas as a downloaded package, for some reason it cannot find the module

@Koaieus
Copy link

Koaieus commented Feb 9, 2023

First off there seems to be a missing dependency for globby. After manually adding it as a dependency it and trying it in a new Nuxt3 app, for me the PR seems to move the problem down by one line.

Secondly there seems to be a nesting problem with the nuxt config where it says options.scan instead of options.sounds.scan which should follow if you follow the guide on github. Or the guide needs to be corrected ;)

I was just about to get to testing the new version but time is up for today so tomorrow I will report more!

Copy link
Member

Tahul commented Feb 10, 2023

@Koaieus ; thanks so much for giving some context.

Going to fix these issues very soon.

@louia
Copy link

louia commented Jun 14, 2023

Now i'm getting ...

Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'Howl')

#32 (comment)

@iamroi
Copy link

iamroi commented Jul 5, 2023

@louia I have the same issue. Have you found any workaround for this?

Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'Howl')

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 this pull request may close these issues.