kewisch / ical.js

Javascript parser for ics (rfc5545) and vcard (rfc6350) data
https://kewisch.github.io/ical.js/
Mozilla Public License 2.0
963 stars 133 forks source link

Could not find a declaration file for module 'ical.js' #719

Closed UMURKAYALI closed 1 day ago

UMURKAYALI commented 1 week ago

I can't add the ical.js to my project.

I followed these steps in "https://www.npmjs.com/package/ical.js"

I'm getting this error:

 Could not find a declaration file for module 'ical.js'. '...../node_modules/ical.js/build/ical.js' implicitly has an 'any' type.
  Try `npm i --save-dev @types/ical.js` if it exists or add a new declaration (.d.ts) file containing `declare module 'ical.js';`

5 import ICAL from 'ical.js'; 

My project details: Angular CLI: 16.2.14 Node: 18.20.2 Package Manager: npm 10.5.2 OS: darwin arm64

jannikac commented 1 week ago

Hi, type generation has just been merged but its not included in a release yet which is why you get the error when installing the package from npm. If you need the types already you can create a package from the current master branch however the master branch is not guaranteed to be stable:

  1. Clone the master branch git clone https://github.com/kewisch/ical.js.git
  2. Install dependencies npm i
  3. Build the library npm run build
  4. Create a tarball npm pack
  5. Copy the tarball to your project and reference it in your package.json like this:
    "dependencies": {
    "ical": "file:/path/to/ical.js-2.0.1.tgz"
    },
  6. Install it to your project with npm i
kewisch commented 1 day ago

I'm going to close this one out, there is one more issue @jannikac wants to work out, then we can spin a release. Thanks for checking in with us!