Closed
Description
On [email protected], importing package.json inside examples/chat-explorer or examples/common-explorer will no longer work, and fail with this error:
Named imports from a JSON file into an ECMAScript module are not allowed when 'module' is set to 'Node16'.
This can be seen in: https://github.com/search?q=repo%3Amicrosoft%2FTypeScript+%22named+imports+are+not+allowed%22&type=issues
Not using a named import (using import * as pkg from "package.json"
) also fails:
examples/chat-explorer/src/HomePage.tsx:1:22 - error TS1543: Importing a JSON file into an ECMAScript module requires a 'type: "json"' import attribute when 'module' is set to 'Node16'.
import * as pkg from "../package.json"
Adding with { type: "json" }
can't be used to fix this because it doesn't work with Node16 resolution:
examples/chat-explorer/src/HomePage.tsx:1:40 - error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'nodenext', or 'preserve'.
import * as pkg from "../package.json" with { type: "json" }
Metadata
Metadata
Assignees
Labels
No labels