Jump to content
Search Community

Installation hiccups on Astro

Alim Bolar test
Moderator Tag

Go to solution Solved by Alim Bolar,

Recommended Posts

Hi 

 

I am new to gsap and new to astro.. so please excuse the 'newbieness'..;-)..

 

I was trying to install gsap on astro and wanted to know the best way forward.. I tried the CDN and the npm install but both didn't work and they gave me this error in the console

 

Uncaught TypeError: Cannot set property window of #<Window> which has only a getter

 

So in astro does one do the import (import {gsap} from 'gsap') within the frontmatter part or do we need to do anyting in the astro.config.mjs?

 

I recollect having similar issue in the past when I was experimenting with gsap with Vue3 but finally the CDN method worked there.. but in astro I can't get it to work with the CDN too..

 

Some hand-holding would be appreciated. I love the product and it works well on codepen etc but I'd like to use it on a personal project using astro.

 

Regards,

Alim

Link to comment
Share on other sites

  • Solution

My mistake.. it seems it's neither the frontmatter nor the astro.config.mjs... it's actually like in any other framework.. it's within the script tags in the component..;-)..

 

Sorry for overthinking the issue, it seems to work fine when I follow the normal methods..;-)..

 

However in the console I still do get the same error message.. but the code/script works fine..

 

Regards,

Alim

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...