Jump to content
Search Community

TypeScript casing conflict for Flip and Draggable type declarations (3.14.2)

katerlouis

Recommended Posts

katerlouis
Posted

Hey folks, long time no read :)

 

 

I'm getting TypeScript errors with `forceConsistentCasingInFileNames` enabled when importing `gsap/Flip` and `gsap/Draggable`:

```
File name '.../node_modules/gsap/types/Flip.d.ts' differs from already included file name
'.../node_modules/gsap/types/flip.d.ts' only in casing.

I'm not gonna pretend my ts skills are good enough to tell you what the actual cause is, but here's what Claude Codes guess is :D

 

```

The cause: all type declaration files in `types/` are lowercase on disk (`flip.d.ts`, `draggable.d.ts`), but `types/index.d.ts` has `/// <reference>` directives only for these two:

```ts
/// <reference path="draggable.d.ts"/>
/// <reference path="flip.d.ts"/>
```

So TypeScript loads `flip.d.ts` (lowercase) via the reference directive. Then when I write `import { Flip } from 'gsap/Flip'`, the wildcard export in `package.json` resolves the types to `types/Flip.d.ts` (capital F). macOS finds the file both ways because the filesystem is case-insensitive — but TypeScript sees two different casings pointing to the same file and flags it.

The other plugins (CustomEase, ScrollTrigger, InertiaPlugin, etc.) don't have `/// <reference>` entries in `index.d.ts`, so there's only one resolution path and no conflict.

 

**Environment:** gsap 3.14.2, TypeScript 5.x, macOS (case-insensitive filesystem), Nuxt/Vite.

**Possible fixes (on your end):**
- Remove the two `/// <reference>` directives from `types/index.d.ts` (if they're not needed — the other plugins work without them)
- Or rename the type files to match the JS module casing (`Flip.d.ts`, `Draggable.d.ts`)

 

On my never-ending quest defeating all red squiggly lines, I'd appreciate your insights on this one :)



EDIT: Sorry for the lack of code formatting; ``` does not work and the post editors code button doesn't seem to work for me 🤷‍♂️

GreenSock
Posted

Howdy, @katerlouis. This sounds like what was reported here, right?: https://github.com/greensock/GSAP/issues/637

 

We'll be pushing out an update in the next few weeks. In the meantime, it should be pretty easy to just change your setting or the file name (cases). I can send you a zip or .tgz with the upcoming release if you'd like to check it and confirm it works well for you. 

katerlouis
Posted

Oh, I didnt know you were on github as well. I would have opened an issue there (or seen the existing one) – thanks for pointing me there!

 

I hope you don't mind me asking, but how comes the PR fixing this is sitting there unmerged for 3+ months? Isn't a patch release from 13.4.2 to 13.4.3 done relatively quickly? Genuinely curious.

Rodrigo
Posted
20 hours ago, katerlouis said:

I hope you don't mind me asking, but how comes the PR fixing this is sitting there unmerged for 3+ months? Isn't a patch release from 13.4.2 to 13.4.3 done relatively quickly? Genuinely curious.

Normally a GSAP release is not just a single patch/update being added to the library, it could range from a few to quite a bit of fixes/improvements and additions. GSAP is always evolving to stay at top in the web animation business so our users can get the best animation tool, but for that we have to test, test and test in order to make sure everything works as expected.

 

Happy Tweening!

  • Like 1
katerlouis
Posted
On 3/30/2026 at 11:40 PM, GreenSock said:

Howdy, @katerlouis. This sounds like what was reported here, right?: https://github.com/greensock/GSAP/issues/637

 

We'll be pushing out an update in the next few weeks. In the meantime, it should be pretty easy to just change your setting or the file name (cases). I can send you a zip or .tgz with the upcoming release if you'd like to check it and confirm it works well for you. 

I'd gladly pop in the new release and feedback if that fixes the issue :)

  • Thanks 1

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