135 lines
5 KiB
Plaintext
135 lines
5 KiB
Plaintext
|
tests/cases/conformance/node/allowJs/index.cjs(3,22): error TS1471: Module 'package/mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead.
|
||
|
tests/cases/conformance/node/allowJs/index.cjs(4,23): error TS1471: Module 'package' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead.
|
||
|
tests/cases/conformance/node/allowJs/node_modules/inner/index.d.mts(2,13): error TS2303: Circular definition of import alias 'cjs'.
|
||
|
tests/cases/conformance/node/allowJs/node_modules/inner/index.d.ts(2,13): error TS2303: Circular definition of import alias 'cjs'.
|
||
|
|
||
|
|
||
|
==== tests/cases/conformance/node/allowJs/index.js (0 errors) ====
|
||
|
// esm format file
|
||
|
import * as cjs from "package/cjs";
|
||
|
import * as mjs from "package/mjs";
|
||
|
import * as type from "package";
|
||
|
cjs;
|
||
|
mjs;
|
||
|
type;
|
||
|
import * as cjsi from "inner/a";
|
||
|
import * as mjsi from "inner/b";
|
||
|
import * as typei from "inner";
|
||
|
import * as ts from "inner/types";
|
||
|
cjsi.mjsSource;
|
||
|
mjsi.mjsSource;
|
||
|
typei.mjsSource;
|
||
|
ts.mjsSource;
|
||
|
==== tests/cases/conformance/node/allowJs/index.mjs (0 errors) ====
|
||
|
// esm format file
|
||
|
import * as cjs from "package/cjs";
|
||
|
import * as mjs from "package/mjs";
|
||
|
import * as type from "package";
|
||
|
cjs;
|
||
|
mjs;
|
||
|
type;
|
||
|
import * as cjsi from "inner/a";
|
||
|
import * as mjsi from "inner/b";
|
||
|
import * as typei from "inner";
|
||
|
import * as ts from "inner/types";
|
||
|
cjsi.mjsSource;
|
||
|
mjsi.mjsSource;
|
||
|
typei.mjsSource;
|
||
|
ts.mjsSource;
|
||
|
==== tests/cases/conformance/node/allowJs/index.cjs (2 errors) ====
|
||
|
// cjs format file
|
||
|
import * as cjs from "package/cjs";
|
||
|
import * as mjs from "package/mjs";
|
||
|
~~~~~~~~~~~~~
|
||
|
!!! error TS1471: Module 'package/mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead.
|
||
|
import * as type from "package";
|
||
|
~~~~~~~~~
|
||
|
!!! error TS1471: Module 'package' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead.
|
||
|
cjs;
|
||
|
mjs;
|
||
|
type;
|
||
|
import * as cjsi from "inner/a";
|
||
|
import * as mjsi from "inner/b";
|
||
|
import * as typei from "inner";
|
||
|
import * as ts from "inner/types";
|
||
|
cjsi.cjsSource;
|
||
|
mjsi.cjsSource;
|
||
|
typei.implicitCjsSource;
|
||
|
ts.cjsSource;
|
||
|
==== tests/cases/conformance/node/allowJs/node_modules/inner/index.d.ts (1 errors) ====
|
||
|
// cjs format file
|
||
|
import * as cjs from "inner/a";
|
||
|
~~~
|
||
|
!!! error TS2303: Circular definition of import alias 'cjs'.
|
||
|
import * as mjs from "inner/b";
|
||
|
import * as type from "inner";
|
||
|
import * as ts from "inner/types";
|
||
|
export { cjs };
|
||
|
export { mjs };
|
||
|
export { type };
|
||
|
export { ts };
|
||
|
export const implicitCjsSource = true;
|
||
|
==== tests/cases/conformance/node/allowJs/node_modules/inner/index.d.mts (1 errors) ====
|
||
|
// esm format file
|
||
|
import * as cjs from "inner/a";
|
||
|
~~~
|
||
|
!!! error TS2303: Circular definition of import alias 'cjs'.
|
||
|
import * as mjs from "inner/b";
|
||
|
import * as type from "inner";
|
||
|
import * as ts from "inner/types";
|
||
|
export { cjs };
|
||
|
export { mjs };
|
||
|
export { type };
|
||
|
export { ts };
|
||
|
export const mjsSource = true;
|
||
|
==== tests/cases/conformance/node/allowJs/node_modules/inner/index.d.cts (0 errors) ====
|
||
|
// cjs format file
|
||
|
import * as cjs from "inner/a";
|
||
|
import * as mjs from "inner/b";
|
||
|
import * as type from "inner";
|
||
|
import * as ts from "inner/types";
|
||
|
export { cjs };
|
||
|
export { mjs };
|
||
|
export { type };
|
||
|
export { ts };
|
||
|
export const cjsSource = true;
|
||
|
==== tests/cases/conformance/node/allowJs/package.json (0 errors) ====
|
||
|
{
|
||
|
"name": "package",
|
||
|
"private": true,
|
||
|
"type": "module",
|
||
|
"exports": {
|
||
|
"./cjs": "./index.cjs",
|
||
|
"./mjs": "./index.mjs",
|
||
|
".": "./index.js"
|
||
|
}
|
||
|
}
|
||
|
==== tests/cases/conformance/node/allowJs/node_modules/inner/package.json (0 errors) ====
|
||
|
{
|
||
|
"name": "inner",
|
||
|
"private": true,
|
||
|
"exports": {
|
||
|
"./a": {
|
||
|
"require": "./index.cjs",
|
||
|
"node": "./index.mjs"
|
||
|
},
|
||
|
"./b": {
|
||
|
"import": "./index.mjs",
|
||
|
"node": "./index.cjs"
|
||
|
},
|
||
|
".": {
|
||
|
"import": "./index.mjs",
|
||
|
"node": "./index.js"
|
||
|
},
|
||
|
"./types": {
|
||
|
"types": {
|
||
|
"import": "./index.d.mts",
|
||
|
"require": "./index.d.cts",
|
||
|
},
|
||
|
"node": {
|
||
|
"import": "./index.mjs",
|
||
|
"require": "./index.cjs"
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|