Skip to content

transformer: `// @jsxFrag `` generates invalid code #16653

@sapphi-red

Description

@sapphi-red
// @jsxRuntime classic
console.log(<></>) // @jsxFrag `

is transformed to

// @jsxRuntime classic
console.log(/* @__PURE__ */ React.createElement(`, null));

. But this should be

// @jsxRuntime classic
console.log(/* @__PURE__ */ React.createElement(React.Fragment, null));

(the pragma comment should be ignored).
playground

Probably a warning should be output like esbuild does (esbuild try).

related: evanw/esbuild@2102e06

Metadata

Metadata

Assignees

Labels

A-transformerArea - Transformer / Transpiler

Type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions