Skip to content

'React' refers to a UMD global, but the current file is a module. Consider adding an import instead. #60132

Closed
@danikane

Description

@danikane

Hi,
JavaScript and TypeScript Nightly version 5.7.20240928 and subsequent versions report the above message.

Next.js 13 or 14, pages router
Windows 10 with WSL2
VSCode 1.93.1

This is a React Fragment and there are several workarounds, but none of them are desired:

  • import React obviously
  • change "jsx": "preserve" -> to "jsx": "react-jsx" in tsconfig.json in which case Next will slap you
    image
  • change to div or whatever :)

image

image
image

On a side note ESLint doesn't pick it up when linting, but then again it's misleading.
Thanks!

Metadata

Metadata

Assignees

Labels

Needs InvestigationThis issue needs a team member to investigate its status.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions