Fix Event after changes to @types/node
#19373
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
After merging my recent PR for
@types/node
, I was alerted that a couple dependents of this package were failing to compile. I have identified a fix that I believe should preserve the original behavior of this code while resolving those errors. I don't know anything about Storybook, so if I'm wrong, or if there's a better fix for the issue, please feel free to do your own thing.For background: I don't think Storybook, or the packages with failing
dtslint
runs,storybook-readme
andstorybook-addon-jsx
, directly depend on@types/node
, but it's common for frontend packages to install build tooling that does depend on the package. This causes Node types to be introduced to the defaulttypeRoot
, so you wind up with Node types merged in with those in the DOM lib. (Storybook may be a bit of an odd duck, because it looks like in some cases, React declares its own empty DOM interfaces in@types/react/globals.d.ts
.)At any rate, I hope the proposed fix works for you.