oku-ui / motion

Motion for Vue is a 5kb animation library for Vue 3 and Nuxt 3. Built on Motion, it's capable of springs, independent transforms, and hardware accelerated animations.
https://motion.oku-ui.com
MIT License
221 stars 6 forks source link

Nuxt Module not working #61

Open Niki2k1 opened 2 hours ago

Niki2k1 commented 2 hours ago

Describe the bug

After upgrading to 0.4.0 I noticed the nuxt module is failing. I migrated from the npm package @oku-ui/motion-nuxt I followed the Installation instructions from the docs and now noticed the nuxt module does not seem to work.

Do I have to still use the @oku-ui/motion-nuxt package?

Reproduction steps:

  1. Create a new Nuxt Project
    pnpm dlx nuxi init
  2. Install @oku-ui/motion
    pnpm install @oku-ui/motion
  3. Add Module to nuxt.config.ts
    // nuxt.config.ts
    export default defineNuxtConfig({
    // ...
    modules: ['@oku-ui/motion/nuxt'],
    // ...
    });
  4. Start the Project
    pnpm dev
  5. See Following Error appear:

    ERROR  Cannot start nuxt:  Nuxt module should be a function: @oku-ui/motion/nuxt                                                        14:51:51
    
    at loadNuxtModuleInstance (node_modules/@nuxt/kit/dist/index.mjs:2549:11)
    at async Module.installModule (node_modules/@nuxt/kit/dist/index.mjs:2478:47)
    at async initNuxt (node_modules/nuxt/dist/index.mjs:4686:5)
    at async NuxtDevServer._load (node_modules/nuxi/dist/chunks/dev2.mjs:1911:5)
    at async NuxtDevServer.load (node_modules/nuxi/dist/chunks/dev2.mjs:1845:7)
    at async NuxtDevServer.init (node_modules/nuxi/dist/chunks/dev2.mjs:1840:5)
    at async Object.run (node_modules/nuxi/dist/chunks/dev-child.mjs:119:5)
    at async runCommand$1 (node_modules/nuxi/dist/shared/nuxi.bd0a2fa0.mjs:1680:16)
    at async runCommand$1 (node_modules/nuxi/dist/shared/nuxi.bd0a2fa0.mjs:1671:11)
    at async runMain$1 (node_modules/nuxi/dist/shared/nuxi.bd0a2fa0.mjs:1809:7)

Reproduction

https://stackblitz.com/edit/nuxt-starter-ydhssw

System Info

System:
    OS: macOS 15.1
    CPU: (12) arm64 Apple M3 Pro
    Memory: 138.03 MB / 18.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 22.11.0 - ~/.nvm/versions/node/v22.11.0/bin/node
    Yarn: 1.22.22 - ~/.nvm/versions/node/v22.11.0/bin/yarn
    npm: 10.9.0 - ~/.nvm/versions/node/v22.11.0/bin/npm
    pnpm: 9.13.1 - ~/.nvm/versions/node/v22.11.0/bin/pnpm
    bun: 1.1.29 - ~/.bun/bin/bun
  Browsers:
    Chrome: 131.0.6778.70
    Safari: 18.1

Used Package Manager

pnpm

Validations

productdevbook commented 2 hours ago

https://github.com/nuxt/nuxt/issues/29838

This problem will be fixed after the new update of Nuxt.

productdevbook commented 2 hours ago

@oku-ui/motion-nuxt no longer in production. We are moving forward with a single package.

Niki2k1 commented 1 hour ago

Thank you for your fast answer!