Jump to content
Search Community

Problem using Observer plugin in Vue JS app

Antdev test
Moderator Tag

Go to solution Solved by Cassie,

Recommended Posts

I have successfully imported Draggable and Inertia into my Vue JS app but for some reason I am getting an error trying to import Observer.

 

I am getting an error:

 

This dependency was not found:

* gsap/Observer in ./node_modules/cache-loader/dist/cjs.js??ref--14-0!./node_modules/ts-loader??ref--14-1!./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader-v16/dist??ref--1-1!./src/App.vue?vue&type=script&lang=ts

 

 

import { gsap } from 'gsap';
import { Observer } from 'gsap/Observer';
import { Draggable } from 'gsap/Draggable';
import { InertiaPlugin } from 'gsap/InertiaPlugin';
import interact from 'interactjs'

gsap.registerPlugin(Draggable);
gsap.registerPlugin(InertiaPlugin);
gsap.registerPlugin(Observer);

 

Link to comment
Share on other sites

1 hour ago, Cassie said:

Hey there - are you using the latest version of GSAP?

Hmm well I am now. I did notice the github version had the observer in types but mine didn't so after failing to manually add these I ran npm install gsap and wow and behold it fixed it. Thank you Cassie.

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...