Skip to content

[4.7 Beta/Dev] import.meta reports invalid "Cannot find name 'meta' ts(2304)" errorΒ #48731

@Jamesernator

Description

@Jamesernator

Bug Report

πŸ”Ž Search Terms

"Cannot find name 'meta'" "2304"

πŸ•— Version & Regression Information

  • This is an issue with new "nodenext" support

⏯ Playground Link

The issue doesn't present in the playground (however it has it's own issues with the code sample).

Instead here is a repo with the issue.

πŸ’» Code

const u = new URL(import.meta.url);

πŸ™ Actual behavior

It produces the error:

Cannot find name 'meta'.ts(2304)

The error vanishes if you edit tsconfig in any way, however if you then edit the file again it reappears.

Screenshot from 2022-04-17 05-23-48

While this error is shown, the rest of the behaviour of import.meta is still fine, like the type is correct and such.

πŸ™‚ Expected behavior

There should be no error.

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScriptFix AvailableA PR has been opened for this issue

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions