You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems that polyfills (and in particular the submit-event.ts) are not being interpreted as a module. This leads to the variable declarations appearing as global.
For example, put this in a typescript file:
import"@hotwired/turbo"submittersByForm.// auto-complete works here, even though this variable is not global
I noticed this issue because another project copied the submit-event.ts polyfill and they are generating conflicting types, but the core issue is here in @hotwired/turbo.
I am not familiar with rollup, but I think this can be fixed by simply adding export {} to the file somewhere, so that TypeScript knows to interpret it as a module and not a global script.
I verified that adding export {} corrects the issue.
The text was updated successfully, but these errors were encountered:
grncdr
changed the title
Polyfill TypeScript types are declaring global variables
Polyfill types are declaring global variables
Jan 26, 2022
It seems that polyfills (and in particular the
submit-event.ts
) are not being interpreted as a module. This leads to the variable declarations appearing as global.For example, put this in a typescript file:
I noticed this issue because another project copied the submit-event.ts polyfill and they are generating conflicting types, but the core issue is here in
@hotwired/turbo
.I am not familiar with rollup, but I think this can be fixed by simply addingexport {}
to the file somewhere, so that TypeScript knows to interpret it as a module and not a global script.I verified that adding
export {}
corrects the issue.The text was updated successfully, but these errors were encountered: