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
Only 2 external dependencies are broken - these are the most interesting ones, because those are "outside" of a user's control.
dotenv and glaze
dotenv has already been fixed in recent versions
arethetypeswrong has been used to analyze popular dependencies that are importable by node10 but not in bundler.
32 packages out of a bit over >4000 (less than 1%)
The issue is almost always due to looking at types/main instead of exports.
But the problem is that exports is often "wrong" because the exports don't have a corresponding .d.*ts
So these are broken under node16+ and bundler.
In these cases, TypeScript 5.x actually gives a good error message that the main or types field is right but exports is wrong and that you should file an issue or upgrade.
Might have broken this in latest versions?
But we don't actually use main/types as the fallback.
Can we just send PRs to help out?
Maybe - some packages published like ~3 years ago
But some just a few days ago.
Maybe could just file issues.
Do we need a flag to just use the fallback with no error?
That flag is just --moduleResolution node10 + --ignoreDeprecations in TS 6.0.
But that "strands you" on 6.0.
Using the fallback allows you to use // @ts-ignore as well!
See below on this.
Related: Fallback behavior for package.jsonexports
If we already have behavior to "union" the types, we should kind of replicate the behavior we have for objects there with readonly and optionality.
Idea is to prioritize the "read" view and be restrictive. If one is readonly, the resulting property is. If one is optional, so is the resulting property.
Module resolution errors that can happen when migrating from
--moduleResolution node10tobundlerDeprecate, remove
--moduleResolution node10#62200Deprecate
--moduleResolution node10#62338Node10 deprecation fixes DefinitelyTyped/DefinitelyTyped#73574
Only 2 external dependencies are broken - these are the most interesting ones, because those are "outside" of a user's control.
arethetypeswrong has been used to analyze popular dependencies that are importable by
node10but not inbundler.The issue is almost always due to looking at
types/maininstead ofexports.exportsis often "wrong" because the exports don't have a corresponding.d.*tsnode16+ andbundler.In these cases, TypeScript 5.x actually gives a good error message that the
mainortypesfield is right butexportsis wrong and that you should file an issue or upgrade.main/typesas the fallback.Can we just send PRs to help out?
Do we need a flag to just use the fallback with no error?
--moduleResolution node10+--ignoreDeprecationsin TS 6.0.// @ts-ignoreas well!Related: Fallback behavior for
package.jsonexports#50762
// @ts-ignore.bundler- but they have a stepping stone with 6.0.Conflicts on modifiers for mapped keys
#62318
readonlyand optionality.readonly, the resulting property is. If one is optional, so is the resulting property.abstract?get/set?gettype.