-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Typescript issue after types change in 3.1.0 #394
Comments
Hi @jekh we'll have a look. Is this blocking you right now, or is it just an annoyance? |
1 similar comment
Hi @jekh we'll have a look. Is this blocking you right now, or is it just an annoyance? |
It does block us from upgrading, yes, since it won't compile. |
Can you try changing your import to something like this: import Anvil from '@anvilco/anvil/dist/index.js'
const client = new Anvil({...})
... I was able to get TSC to understand the type that way and successfully compile. We will fix the root problem at some point, but I think for now this is a good workaround. Let me know if this works! |
@jekh did that work for you and allow you to upgrade? |
The types update in 3.1.0 appears to have caused an issue when importing and using Anvil in a typescript project, at least when using ESM.
In 3.1.0 (but not 3.0.1), typescript appears to think
Anvil
is a namespace, and doesn't recognize it as a class.The issue appears to occur because of this change in index.d.ts from
export = Anvil
toexport default Anvil
. Manually changing that single line back appears to fix the type error.I'm not totally sure why that change would cause this issue, or what the implications of it are. Only that it does seem to be the culprit!
The text was updated successfully, but these errors were encountered: