motion icon indicating copy to clipboard operation
motion copied to clipboard

Compatibility Issue on Nuxt 3

Open miguelCassimiro99 opened this issue 2 years ago โ€ข 11 comments

Hi there, I'm having troubles using the latest version of the vueuse/motion with nuxt 3 when I follow the the Doc about Nuxt Usage. If you pass the: '@vueuse/motion/nuxt' The error returned is about: Cannot start nuxt: Package subpath './nuxt' is not defined by "exports" in...

I tried a few thing, but not solve my problem: I tried to change the version of beta.12 to beta.23 and I removed too the /nuxt on nuxt.config.ts. The error changed, but still there.

Nuxt 3.0.0-rc.13 @vueuse/motion": "^2.0.0-beta.12

Does have someone with the same problem and found a solution?

miguelCassimiro99 avatar Nov 16 '22 00:11 miguelCassimiro99

Same problem.

manLuke avatar Nov 16 '22 10:11 manLuke

Problem might be in the deprecated addAutoImportDir function used in the nuxt module, it should be replaced with addImportsDir.

Also the publicRuntimeConfig option used in the module is no longer present in nuxt 3, as it was replaced with runtimeConfig.public.

I've made a patch to fix the compatibility of @vueuse/motion beta.24 with nuxt 3.0.0 stable release, you can find it here and apply it with yarn patch-package.

grunghi avatar Nov 16 '22 17:11 grunghi

@grunghi can you maybe create a PR with that fix so that @antfu can merge it?

itpropro avatar Nov 18 '22 16:11 itpropro

Thanks @grunghi . If this patch can be merged it will helps a lot.

miguelCassimiro99 avatar Nov 18 '22 16:11 miguelCassimiro99

The patch doesn't seem to work on my end, trying to use it with yarns native patch support.

It's the module builder that needs to be updated, this patch can't just be changed to a PR unfortunately, I think the package.json needs to be updated on the module builder parts, and then republished.

itzaks avatar Nov 22 '22 11:11 itzaks

/cc @Tahul

antfu avatar Nov 22 '22 11:11 antfu

Anyone have it working in nuxt3 yet?

timvandaatselaar avatar Nov 29 '22 11:11 timvandaatselaar

Anyone have it working in nuxt3 yet?

Seems like there was an unannounced release of beta-25 that you can use now!

"@vueuse/motion": "2.0.0-beta.25",

Works fine with nuxt 3.0. ๐Ÿš€โœจ

itzaks avatar Nov 29 '22 16:11 itzaks

Anyone have it working in nuxt3 yet?

Seems like there was an unannounced release of beta-25 that you can use now!

"@vueuse/motion": "2.0.0-beta.25",

Works fine with nuxt 3.0. ๐Ÿš€โœจ

can this be the default ver when we install? @Tahul

hi-reeve avatar Mar 02 '23 02:03 hi-reeve

Cannot install @vueuse/motion with Nuxt 3.2.3. Is there a particular way to install it for Nuxt 3 that I have missed?

Here is the Error report:

EDIT: ni -D @vueuse/[email protected] works

17:33:25 on main โœน โœญ)โ”€โ”€> ni -D @vueuse/motion โ”€โ”€(Tue,Mar07)โ”€โ”˜ npm ERR! code ERESOLVE npm ERR! ERESOLVE could not resolve npm ERR! npm ERR! While resolving: [email protected] npm ERR! Found: [email protected] npm ERR! node_modules/vue npm ERR! peer vue@">= 3.0.0 < 4" from @fortawesome/[email protected] npm ERR! node_modules/@fortawesome/vue-fontawesome npm ERR! @fortawesome/vue-fontawesome@"^3.0.2" from the root project npm ERR! peer vue@"^3.2.47" from @nuxt/[email protected] npm ERR! node_modules/@nuxt/vite-builder npm ERR! @nuxt/vite-builder@"3.2.3" from [email protected] npm ERR! node_modules/nuxt npm ERR! peer nuxt@"^3.0.0" from @vueuse/[email protected] npm ERR! node_modules/@vueuse/nuxt npm ERR! dev @vueuse/nuxt@"^9.13.0" from the root project npm ERR! 1 more (the root project) npm ERR! 10 more (@unhead/vue, @vitejs/plugin-vue, ...) npm ERR! npm ERR! Could not resolve dependency: npm ERR! dev @vueuse/motion@"" from the root project npm ERR! npm ERR! Conflicting peer dependency: [email protected] npm ERR! node_modules/vue npm ERR! peer vue@">= 2.5 < 2.7" from @vue/[email protected] npm ERR! node_modules/@vue/composition-api npm ERR! peerOptional @vue/composition-api@"^1.4.1" from @vueuse/[email protected] npm ERR! node_modules/@vueuse/motion npm ERR! dev @vueuse/motion@"" from the root project npm ERR! npm ERR! Fix the upstream dependency conflict, or retry npm ERR! this command with --force or --legacy-peer-deps npm ERR! to accept an incorrect (and potentially broken) dependency resolution. npm ERR! npm ERR! npm ERR! For a full report see: npm ERR! /Users/sueholder/.npm/_logs/2023-03-07T17_34_20_532Z-eresolve-report.txt

npm ERR! A complete log of this run can be found in: npm ERR! /Users/sueholder/.npm/_logs/2023-03-07T17_34_20_532Z-debug-0.log

SPH73 avatar Mar 07 '23 17:03 SPH73

Anyone have it working in nuxt3 yet?

Seems like there was an unannounced release of beta-25 that you can use now! "@vueuse/motion": "2.0.0-beta.25", Works fine with nuxt 3.0. ๐Ÿš€โœจ

can this be the default ver when we install? @Tahul

I wish it could but that would send renovate updates to all the projects that uses it and I'm not ready to handle that. :(

I wish I could find some maintainers and contributors to that project that helped me on the day-to-day tasks!

Tahul avatar Mar 09 '23 13:03 Tahul