-
Notifications
You must be signed in to change notification settings - Fork 13.1k
Open
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: Node ESMLike ES Modules, but specific to Node.js support (cts, cts, mjs, mts)Like ES Modules, but specific to Node.js support (cts, cts, mjs, mts)Help WantedYou can do thisYou can do this
Milestone
Description
🔎 Search Terms
import.meta' meta-property '--module' option 'es2020' 'es2022' 'esnext' 'system' 'node12' 'nodenext'
🕗 Version & Regression Information
- This is the behavior in every version I tried, and I reviewed the FAQ for entries about the
moduleoption
⏯ Playground Link
💻 Code
console.log(import.meta.url);🙁 Actual behavior
When setting the module option to node16 or node18 you get the error message:
The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node12', or 'nodenext'.
🙂 Expected behavior
node16 and node18 should be supported. import.meta.url is available in those versions of Node and it makes no sense that this setting would say that it's available in Node 12 and the latest version of Node, but not the intermediate versions of Node.
Additional information about the issue
No response
ExE-Boss and RyanCavanaughExE-Boss
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: Node ESMLike ES Modules, but specific to Node.js support (cts, cts, mjs, mts)Like ES Modules, but specific to Node.js support (cts, cts, mjs, mts)Help WantedYou can do thisYou can do this