-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
Regression: class implementing File
errors with "missing property 'prototype'"
#52166
Regression: class implementing File
errors with "missing property 'prototype'"
#52166
Comments
As @akomm pointed out in remix-run/remix#4371 (comment), we do get the error if we include types for any built-in Node modules: https://tsplay.dev/WYeObW |
@iisaduan @RyanCavanaugh Is there anything we can do to help to get this one fixed? I'm happy to help out in any way I can |
This problem would have been spotted earlier, if remix would actually type check out of the box when building. I don't get why its not, like for example in next. This is why nobody noticed this problem, as you only notice it if you fill the gap of missing typecheck and realize this failure. When you are in dev mode your IDE will only show you the problems in the currently working files. You actually have to manually run typescript. Another issue is that they use some internal version so the dependency of TS you install (and the remix create adds) is totally de-sync with the actually used. So I had an issue using 5.1 features having ts 5.1 when I realized remix does not use it at all. The communication here is bad and the behavior unexpected, even if it has reasons (esbuild or babel used, etc...). |
@RyanCavanaugh Since 5.2 is now released, I guess this will not be fixed anytime soon? If there's something we can help with to get this fixed, we're happy to help out! |
Something is wrong with the node .d.ts. It's basically saying, TL;DR type __Blob = (the type of the global Blob value)
interface Blob extends __Blob { } The implication here is that the instance type of @iisaduan is investigating the right fix to the node .d.ts |
Bug Report
Original issue in the Remix repo: remix-run/remix#4371
🔎 Search Terms
lib.dom.d.ts, File, Blob, interface, declare var, implements, prototype
🕗 Version & Regression Information
This changed between TS 4.8.4 and TS 4.9.3. Typechecking passed in 4.8.4, fails in 4.9.3+
⏯ Playground Link
Hard to reproduce in a playground because the issue only occurs when the class type definition is within
node_modules/
.Playground shows no errors 🤷: https://www.typescriptlang.org/play?ssl=18&ssc=2&pln=1&pc=1#code/KYDwDg9gTgLgBAE2AYwDYEMrDm9BnPOAOQiQHkA7AEQEs8BrAMRtWxoFsxX3gKZDmrOAG8AUHAlwwUGgDd0MbADMWwMAoAWAbnGSYATzDAAXHDwwZFAOY7JUmfMVnUNZMCgB+W5Iroep80sbXQkMcwBZUhoVYARTCgBXdgAjd28JAHdgZPoaGAAlYAwYOWAABU0AixprdJwICkCE5BhoAAoVVnUYDSqggBo4AyM+mqtBvBc3T1MxOztzTBh4pNSoOrteOLhElLSQuABfOAAfOASKJBUKWIBKOqtgeDwaAC9gNtuVvfWDydcPotYB5vmtBlsQTtVu5BsNgJDAmMvnAAEKoCDJOqYKDofQohJKJTuT6mMpQCDsOjAAA8AEEoDi8QSiVAAHx1QLAPwkuCFdAIdDJVgAZQsXPY1PQFH07IOihAMB5ZIpVOpiOssrsj3gAG1hfoUhBUAA6VqioIAFXQVgAujz1cFDqIgA
💻 Code
To reproduce:
npx create-remix@latest
cd
into project and runnpm install
if you skipped that in step (2)npm run typecheck
🙁 Actual behavior
The
prototype: Blob
code occurs withindeclare var Blob
, not withininterface Blob
.From my understanding, it seems like TS is conflating the
Blob
var and interface and that's what's causing this issue.🙂 Expected behavior
Typechecking succeeds
The text was updated successfully, but these errors were encountered: