leaonline / easy-speech

🔊 Cross browser Speech Synthesis also known as Text to speech or TTS; no dependencies; uses Web Speech API

Home Page:https://leaonline.github.io/easy-speech/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Typescript types don't work out of the box

enyo opened this issue · comments

After installing and importing the package, I get:

There are types at '.../node_modules/easy-speech/dist/index.d.ts', but this result could not be resolved when respecting package.json "exports". The 'easy-speech' library may need to update its package.json or typings.

I'm not entirely sure, but I think changing the exports field to this should work:

"exports": {
  ".": {
    "import": {
      "types": "./dist/index.d.ts",
      "default": "./dist/EasySpeech.js"
    }
  }
},

Please try easy-speech@2.4.0-rc.0 and let me know if things work as expected

commented

Ran into the same problem. Upgrading the version to 2.4.0-rc.0 fixed it for me.

@annam002 thanks for the feedback. I will release 2.4.0 this week, since there were no complaints on the rc so far. @enyo please let me know if there are still issues with types in the RC

@jankapunkt yes that worked. Thanks!