Jump to content
Search Community

Cossetteqc

Members
  • Posts

    2
  • Joined

  • Last visited

Cossetteqc's Achievements

  1. Hi guys ! My time to apologize for the delay, didn't get notified for your answers. @Rodrigo I'm already using your approach for my SvelteKit apps and it works well. But I don't have any types. Maybe you'll have a solution for me like adding the types in my tsconfig which doesn't work for me either ? I got this in my tsconfig.json: { "extends": "./.svelte-kit/tsconfig.json", "compilerOptions": { "allowJs": true, "checkJs": true, "esModuleInterop": true, "forceConsistentCasingInFileNames": true, "resolveJsonModule": true, "skipLibCheck": true, "sourceMap": true }, "files": ["node_modules/gsap/types/index.d.ts"] The only way for me to get the types is to import from the package directly. But this breaks my app in production. Unable to build on vercel/netlify, errors when building locally. So either I have the types but can't use gsap as it's broken, or I get gsap without the types, and have to create a declaration.d.ts file to declare all the modules. I can grant access to any github repo if you need to investigate this, or any other solution if needed, let me know ✌️
  2. Hi team ! I'm a bit surprised that after an hour or so in the forums, that this issue is still unresolved by the team, or the community. I'm having trouble to find a simple solution in using gsap (with types) in my project. I read everywhere about ESModule Vs UMD, but none works for me on my project. The only import that is working for me is : import { ScrollTrigger } from 'gsap/dist/ScrollTrigger.js'; If I use it without the extension, my app throw a Cannot find module error telling me to use the .js extension. Believe me, I tried every single import (ES, UMD, ...), this is the only one working in production. Doesn't bother me that much, I created an wrapper around it so it's easier to import in my svelte files. The only thing I have not are the types. When importing JS files, I don't have any types out of the box so I can't type any of my gsap animations. I looked into solutions or questions in the forum but none seems to work for me, the Sveltekit team answered to you that your package was broken and closed the issue : https://github.com/sveltejs/kit/issues/9824 I read in your forum that your team says it's a Vite or Sveltekit issue, so I don't really know who's right or not. Anyway, I think I'm not alone that want to this this fixed, hope you guys will fix this in future versions! Or come with a robust solution to get both imports and types working together. Thanks a lot! Valentin
×
×
  • Create New...