Open DenisTimofijuk opened 2 years ago
Hmmm, this looks very strange indeed. What you're describing is impossible, from what I know. I think there is something else to take into consideration. Can you please share a bit more details and maybe some screenshots?
I published it in to github. Please check all details here: chrome-extension-test. Error is coming from popup -> index.ts and content-> index.ts. Thei all has same myinput declared and this is causing an error for type script .
I've managed to reproduce it here, confirming the bug. This is something related to the TS configuration I believe, don't know how to fix it so far. As a hotfix, you can follow advice from here https://stackoverflow.com/questions/35758584/cannot-redeclare-block-scoped-variable-typescript and add export {}
to the file, that works. But I think there must be a better solution...
Thank you for looking in to this. adding empty export works for me.
Great! Let's keep this issue open as a reminder, maybe I'll find a better solution later on.
I am writing everything with vanilla JS. Somehow I am not allowed to have same variable names declared on a content and popup files. Those are independent separate files, why TS is looking in to them as a block-scope?