hypernym-studio / nuxt-gsap

GSAP module for Nuxt.
MIT License
294 stars 12 forks source link

Flip plugin undefined #39

Closed mitchellcliftonbarton closed 1 year ago

mitchellcliftonbarton commented 1 year ago

Steps to Reproduce

Nuxt: 2.15.7 nuxt-gsap-module: 1.7.3 gsap: 3.11.4 Node: 16.13.0

In my nuxt project, I have 'nuxt-gsap-module' installed, and configured in the nuxt.config.js file like so:

  buildModules: [
    'nuxt-gsap-module'
  ],

  gsap: {
    extraPlugins: {
      draggable: true,
      scrollTo: true,
    },
    clubPlugins: {
      inertia: true,
      splitText: true,
      flip: true,
    }
  },

  build: {
    transpile: ['gsap']
  }

I also have gsap installed using the gsap-bonus.tgz file so that I can use the extra plugins.

Current Behavior

With this setup, I keep getting the following error in regards to the 'Flip' plugin:

Uncaught TypeError: Cannot read properties of undefined (reading 'fit')

When I console log `this.$Flip', I get undefined. This was working for me a few weeks ago, not sure why it wont work now.

Expected Behavior

The Flip plugin should not be undefined.

Additional Details

No response

Version

1.7.3

ivodolenc commented 1 year ago

Hi, Flip should be enabled within extraPlugins object (not clubPlugins):

// nuxt.config.js

export default {
  gsap: {
    extraPlugins: {
      flip: true
    }
  }
}

Try again and let me know if it works as expected.

mitchellcliftonbarton commented 1 year ago

Ahhhhh of course! That worked perfectly!

Thanks for the quick response!

ivodolenc commented 1 year ago

No problem 👍 I'm closing this as resolved.