Skip to content

Allow import.meta with module: es2020 #41249

@saschanaz

Description

@saschanaz

TypeScript Version: 4.0.3

Search Terms: import.meta es2020

Code

export function foo() {
  return import.meta.url;
}

Expected behavior: It should work

Actual behavior: The 'import.meta' meta-property is only allowed when the '--module' option is 'esnext' or 'system'.ts(1343)

Playground Link:

Related Issues:

Metadata

Metadata

Assignees

Labels

CommittedThe team has roadmapped this issueES NextNew featurers for ECMAScript (a.k.a. ESNext)Fix AvailableA PR has been opened for this issueGood First IssueWell scoped, documented and has the green lightHelp WantedYou can do thisSuggestionAn idea for TypeScript

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions