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
{{ message }}
Repository navigation
Switch from node12 to node16 to avoid top-level await issues #48646
Today, --moduleResolution node12 is a pit-of-failure experience because Node.js 12 is already oldish and doesn't support top-level await. This was brought up in #46452 (and in this comment #46452 (comment))
Before TypeScript 4.7 RC, we should remove node12 as an option and provide a node16 option instead.`
I get wanting a newer numbered node version (and am all for it); but is there a reason to remove the node12 support? It's the first node version with native esm support, and it has some important caveats in its resolution (in addition to the whole no-TLA thing) that are fixed or changed by later versions.
It's the first node version with native esm support, and it has some important caveats in its resolution (in addition to the whole no-TLA thing) that are fixed or changed by later versions.
The way I see it, every time a user has to decide between these, and every time we have to list every possible option, is a place where dropping node12 and starting at node14/node16 could improve those experiences. So let's not provide awkward middle grounds leading up to the experience that most users will want, and let's not obligate ourselves to supporting the caveats either of Node 12 either.
Like, I'm all for nodenext being the preferred mode - you really don't have a good reason to not track latest node unless you're building for maximal compatibility.
Well people need a stable target. I just think we have a decent amount of agreement on #46452 (comment) around dropping node12 in favor of a later version which would both allow us to shed some extra corner-cases and remove a step of friction for users.
FYI Daniel Rosenwasser (@DanielRosenwasser) TLA in node is still documented as experimental even in 18 (though there's an open PR to stabilize it in the 18 timeframe since it's officially stabilized in v8). If we respect the docs, we shouldn't even allow TLA in a hypothetical node18 just yet.
Activity
weswigham commentedon Apr 11, 2022
I get wanting a newer numbered
nodeversion (and am all for it); but is there a reason to remove thenode12support? It's the firstnodeversion with native esm support, and it has some important caveats in its resolution (in addition to the whole no-TLA thing) that are fixed or changed by later versions.DanielRosenwasser commentedon Apr 12, 2022
The way I see it, every time a user has to decide between these, and every time we have to list every possible option, is a place where dropping
node12and starting atnode14/node16could improve those experiences. So let's not provide awkward middle grounds leading up to the experience that most users will want, and let's not obligate ourselves to supporting the caveats either of Node 12 either.weswigham commentedon Apr 12, 2022
You don't see users wanting to support every node version that supports esm format source code?
weswigham commentedon Apr 12, 2022
Like, I'm all for
nodenextbeing the preferred mode - you really don't have a good reason to not track latest node unless you're building for maximal compatibility.DanielRosenwasser commentedon Apr 12, 2022
Well people need a stable target. I just think we have a decent amount of agreement on #46452 (comment) around dropping
node12in favor of a later version which would both allow us to shed some extra corner-cases and remove a step of friction for users.weswigham commentedon Apr 12, 2022
node16will be the first node version to supporthttpsimports in it's release line, as an FYI.weswigham commentedon Apr 27, 2022
FYI Daniel Rosenwasser (@DanielRosenwasser) TLA in node is still documented as experimental even in 18 (though there's an open PR to stabilize it in the 18 timeframe since it's officially stabilized in v8). If we respect the docs, we shouldn't even allow TLA in a hypothetical node18 just yet.
dnalborczyk commentedon May 1, 2022
Daniel Rosenwasser (@DanielRosenwasser) Wesley Wigham (@weswigham)
node v12has reached end-of-life April 30th 2022 https://nodejs.org/en/about/releases/ it's probably a good idea to dropnode12altogether and move tonode16directly forTypeScript v4.7.DanielRosenwasser commentedon May 3, 2022
After this change, a nightly, RC, or stable version of TypeScript will issue the following error message:
Instead of
node12, you should switch tonode16ornodenext.