TypeScript/tests/baselines/reference/nodeModulesImportAssertions(module=node12).errors.txt
Wesley Wigham de23842e45
Allow import assertions on esm imports under module: nodenext (#46630)
* Allow import assertions on esm imports under module: nodenext

* Changes to copy

Co-authored-by: Andrew Branch <andrew@wheream.io>
2021-11-02 15:34:37 -07:00

28 lines
2 KiB
Plaintext

tests/cases/conformance/node/index.ts(1,18): error TS7062: JSON imports are experimental in ES module mode imports.
tests/cases/conformance/node/index.ts(1,35): error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext' or 'nodenext'.
tests/cases/conformance/node/otherc.cts(1,35): error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext' or 'nodenext'.
tests/cases/conformance/node/otherc.cts(2,22): error TS7062: JSON imports are experimental in ES module mode imports.
tests/cases/conformance/node/otherc.cts(2,40): error TS1324: Dynamic imports only support a second argument when the '--module' option is set to 'esnext' or 'nodenext'.
==== tests/cases/conformance/node/index.ts (2 errors) ====
import json from "./package.json" assert { type: "json" };
~~~~~~~~~~~~~~~~
!!! error TS7062: JSON imports are experimental in ES module mode imports.
~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext' or 'nodenext'.
==== tests/cases/conformance/node/otherc.cts (3 errors) ====
import json from "./package.json" assert { type: "json" }; // should error, cjs mode imports don't support assertions
~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext' or 'nodenext'.
const json2 = import("./package.json", { assert: { type: "json" } }); // should be fine
~~~~~~~~~~~~~~~~
!!! error TS7062: JSON imports are experimental in ES module mode imports.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS1324: Dynamic imports only support a second argument when the '--module' option is set to 'esnext' or 'nodenext'.
==== tests/cases/conformance/node/package.json (0 errors) ====
{
"name": "pkg",
"private": true,
"type": "module"
}