Skip to content

Latest commit

Β 

History

History
625 lines (487 loc) Β· 24.7 KB

test-result.5.0.0-dev.20230103.md

File metadata and controls

625 lines (487 loc) Β· 24.7 KB

TypeScript Module System Demo

TypeScript: 5.0.0-dev.20230103

Legends

  • 🟒: both compile and runtime are working correctly
  • 🟑: for compile, it means there is an error, but can be suppressed (e.g. with skipLibCheck)
    for runtime, it means the compile fails, but runtime is working
  • πŸ”΄: compile and/or runtime fails
  • ❌: compile success, but runtime fails. Potentially a TypeScript bug.
  • βž–: invalid usage in this test configuration

Import Syntax:

  • default as: import { default as m } from 'm'
  • default: import m from 'm'
  • * as: import * as m from 'm'
  • named: import { something } from 'm'

Test Results

module Package Type import: default as import: default import: * as import: { named }
commonjs assert πŸ’» compile πŸ”΄ TS1259-e πŸ”΄ TS1259-e 🟒 βž–
πŸƒ runtime πŸ”΄ type-not-fn πŸ”΄ type-not-fn 🟒 βž–
assertron πŸ’» compile 🟑 TS1259-e-t 🟑 TS1259-e-t 🟑 TS1259-e-t βž–
πŸƒ runtime 🟑 🟑 🟑 βž–
cjs πŸ’» compile 🟒 🟒 🟒 βž–
πŸƒ runtime 🟒 🟒 🟒 βž–
es-cjs πŸ’» compile 🟒 🟒 🟒 βž–
πŸƒ runtime 🟒 🟒 🟒 βž–
esm πŸ’» compile βž– βž– βž– βž–
πŸƒ runtime βž– βž– βž– βž–
esm-cjs πŸ’» compile 🟒 🟒 🟒 βž–
πŸƒ runtime ❌ Error ❌ Error-1 ❌ Error-2 βž–
named-cjs πŸ’» compile βž– βž– 🟒 🟒
πŸƒ runtime βž– βž– 🟒 🟒
named-es-cjs πŸ’» compile βž– βž– 🟒 🟒
πŸƒ runtime βž– βž– 🟒 🟒
named-esm πŸ’» compile βž– βž– βž– βž–
πŸƒ runtime βž– βž– βž– βž–
named-esm-cjs πŸ’» compile βž– βž– 🟒 🟒
πŸƒ runtime βž– βž– 🟒 🟒
param-case πŸ’» compile πŸ”΄ TS1259-e-1 πŸ”΄ TS1259-e-1 πŸ”΄ TS2497-e βž–
πŸƒ runtime πŸ”΄ type-not-fn-1 πŸ”΄ type-not-fn-1 🟑 βž–
es2015 assert πŸ’» compile πŸ”΄ TS1259-a πŸ”΄ TS1259-a 🟒 βž–
πŸƒ runtime πŸ”΄ syntax πŸ”΄ syntax ❌ syntax βž–
assertron πŸ’» compile 🟑 TS1259-a-t 🟑 TS1259-a-t 🟑 TS1259-a-t βž–
πŸƒ runtime πŸ”΄ syntax πŸ”΄ syntax πŸ”΄ syntax βž–
cjs πŸ’» compile 🟒 🟒 🟒 βž–
πŸƒ runtime ❌ syntax ❌ syntax ❌ syntax βž–
es-cjs πŸ’» compile 🟒 🟒 🟒 βž–
πŸƒ runtime ❌ syntax ❌ syntax ❌ syntax βž–
esm πŸ’» compile βž– βž– βž– βž–
πŸƒ runtime βž– βž– βž– βž–
esm-cjs πŸ’» compile 🟒 🟒 🟒 βž–
πŸƒ runtime ❌ syntax ❌ syntax ❌ syntax βž–
named-cjs πŸ’» compile βž– βž– 🟒 🟒
πŸƒ runtime βž– βž– ❌ syntax ❌ syntax
named-es-cjs πŸ’» compile βž– βž– 🟒 🟒
πŸƒ runtime βž– βž– ❌ syntax ❌ syntax
named-esm πŸ’» compile βž– βž– βž– βž–
πŸƒ runtime βž– βž– βž– βž–
named-esm-cjs πŸ’» compile βž– βž– 🟒 🟒
πŸƒ runtime βž– βž– ❌ syntax ❌ syntax
param-case πŸ’» compile πŸ”΄ TS1259-a-1 πŸ”΄ TS1259-a-1 πŸ”΄ TS2497-a βž–
πŸƒ runtime πŸ”΄ syntax πŸ”΄ syntax πŸ”΄ syntax βž–
es2020 assert πŸ’» compile πŸ”΄ TS1259-a πŸ”΄ TS1259-a 🟒 βž–
πŸƒ runtime πŸ”΄ syntax πŸ”΄ syntax ❌ syntax βž–
assertron πŸ’» compile 🟑 TS1259-a-t 🟑 TS1259-a-t 🟑 TS1259-a-t βž–
πŸƒ runtime πŸ”΄ syntax πŸ”΄ syntax πŸ”΄ syntax βž–
cjs πŸ’» compile 🟒 🟒 🟒 βž–
πŸƒ runtime ❌ syntax ❌ syntax ❌ syntax βž–
es-cjs πŸ’» compile 🟒 🟒 🟒 βž–
πŸƒ runtime ❌ syntax ❌ syntax ❌ syntax βž–
esm πŸ’» compile βž– βž– βž– βž–
πŸƒ runtime βž– βž– βž– βž–
esm-cjs πŸ’» compile 🟒 🟒 🟒 βž–
πŸƒ runtime ❌ syntax ❌ syntax ❌ syntax βž–
named-cjs πŸ’» compile βž– βž– 🟒 🟒
πŸƒ runtime βž– βž– ❌ syntax ❌ syntax
named-es-cjs πŸ’» compile βž– βž– 🟒 🟒
πŸƒ runtime βž– βž– ❌ syntax ❌ syntax
named-esm πŸ’» compile βž– βž– βž– βž–
πŸƒ runtime βž– βž– βž– βž–
named-esm-cjs πŸ’» compile βž– βž– 🟒 🟒
πŸƒ runtime βž– βž– ❌ syntax ❌ syntax
param-case πŸ’» compile πŸ”΄ TS1259-a-1 πŸ”΄ TS1259-a-1 πŸ”΄ TS2497-a βž–
πŸƒ runtime πŸ”΄ syntax πŸ”΄ syntax πŸ”΄ syntax βž–
es2022 assert πŸ’» compile πŸ”΄ TS1259-a πŸ”΄ TS1259-a 🟒 βž–
πŸƒ runtime πŸ”΄ syntax πŸ”΄ syntax ❌ syntax βž–
assertron πŸ’» compile 🟑 TS1259-a-t 🟑 TS1259-a-t 🟑 TS1259-a-t βž–
πŸƒ runtime πŸ”΄ syntax πŸ”΄ syntax πŸ”΄ syntax βž–
cjs πŸ’» compile 🟒 🟒 🟒 βž–
πŸƒ runtime ❌ syntax ❌ syntax ❌ syntax βž–
es-cjs πŸ’» compile 🟒 🟒 🟒 βž–
πŸƒ runtime ❌ syntax ❌ syntax ❌ syntax βž–
esm πŸ’» compile βž– βž– βž– βž–
πŸƒ runtime βž– βž– βž– βž–
esm-cjs πŸ’» compile 🟒 🟒 🟒 βž–
πŸƒ runtime ❌ syntax ❌ syntax ❌ syntax βž–
named-cjs πŸ’» compile βž– βž– 🟒 🟒
πŸƒ runtime βž– βž– ❌ syntax ❌ syntax
named-es-cjs πŸ’» compile βž– βž– 🟒 🟒
πŸƒ runtime βž– βž– ❌ syntax ❌ syntax
named-esm πŸ’» compile βž– βž– βž– βž–
πŸƒ runtime βž– βž– βž– βž–
named-esm-cjs πŸ’» compile βž– βž– 🟒 🟒
πŸƒ runtime βž– βž– ❌ syntax ❌ syntax
param-case πŸ’» compile πŸ”΄ TS1259-a-1 πŸ”΄ TS1259-a-1 πŸ”΄ TS2497-a βž–
πŸƒ runtime πŸ”΄ syntax πŸ”΄ syntax πŸ”΄ syntax βž–
esnext assert πŸ’» compile πŸ”΄ TS1259-a πŸ”΄ TS1259-a 🟒 βž–
πŸƒ runtime πŸ”΄ syntax πŸ”΄ syntax ❌ syntax βž–
assertron πŸ’» compile 🟑 TS1259-a-t 🟑 TS1259-a-t 🟑 TS1259-a-t βž–
πŸƒ runtime πŸ”΄ syntax πŸ”΄ syntax πŸ”΄ syntax βž–
cjs πŸ’» compile 🟒 🟒 🟒 βž–
πŸƒ runtime ❌ syntax ❌ syntax ❌ syntax βž–
es-cjs πŸ’» compile 🟒 🟒 🟒 βž–
πŸƒ runtime ❌ syntax ❌ syntax ❌ syntax βž–
esm πŸ’» compile βž– βž– βž– βž–
πŸƒ runtime βž– βž– βž– βž–
esm-cjs πŸ’» compile 🟒 🟒 🟒 βž–
πŸƒ runtime ❌ syntax ❌ syntax ❌ syntax βž–
named-cjs πŸ’» compile βž– βž– 🟒 🟒
πŸƒ runtime βž– βž– ❌ syntax ❌ syntax
named-es-cjs πŸ’» compile βž– βž– 🟒 🟒
πŸƒ runtime βž– βž– ❌ syntax ❌ syntax
named-esm πŸ’» compile βž– βž– βž– βž–
πŸƒ runtime βž– βž– βž– βž–
named-esm-cjs πŸ’» compile βž– βž– 🟒 🟒
πŸƒ runtime βž– βž– ❌ syntax ❌ syntax
param-case πŸ’» compile πŸ”΄ TS1259-a-1 πŸ”΄ TS1259-a-1 πŸ”΄ TS2497-a βž–
πŸƒ runtime πŸ”΄ syntax πŸ”΄ syntax πŸ”΄ syntax βž–
node16 assert πŸ’» compile πŸ”΄ TS1259-a πŸ”΄ TS1259-a 🟒 βž–
πŸƒ runtime πŸ”΄ type-not-fn πŸ”΄ type-not-fn 🟒 βž–
assertron πŸ’» compile 🟑 TS1259-a-t 🟑 TS1259-a-t 🟑 TS1259-a-t βž–
πŸƒ runtime 🟑 🟑 🟑 βž–
cjs πŸ’» compile 🟒 🟒 🟒 βž–
πŸƒ runtime 🟒 🟒 🟒 βž–
es-cjs πŸ’» compile 🟒 🟒 🟒 βž–
πŸƒ runtime 🟒 🟒 🟒 βž–
esm πŸ’» compile βž– βž– βž– βž–
πŸƒ runtime βž– βž– βž– βž–
esm-cjs πŸ’» compile 🟒 🟒 🟒 βž–
πŸƒ runtime ❌ Error-3 ❌ Error-4 ❌ Error-5 βž–
named-cjs πŸ’» compile βž– βž– 🟒 🟒
πŸƒ runtime βž– βž– 🟒 🟒
named-es-cjs πŸ’» compile βž– βž– 🟒 🟒
πŸƒ runtime βž– βž– 🟒 🟒
named-esm πŸ’» compile βž– βž– βž– βž–
πŸƒ runtime βž– βž– βž– βž–
named-esm-cjs πŸ’» compile βž– βž– 🟒 🟒
πŸƒ runtime βž– βž– 🟒 🟒
param-case πŸ’» compile πŸ”΄ TS1259-a-1 πŸ”΄ TS1259-a-1 πŸ”΄ TS2497-a βž–
πŸƒ runtime πŸ”΄ type-not-fn-1 πŸ”΄ type-not-fn-1 🟑 βž–
nodenext assert πŸ’» compile πŸ”΄ TS1259-a πŸ”΄ TS1259-a 🟒 βž–
πŸƒ runtime πŸ”΄ type-not-fn πŸ”΄ type-not-fn 🟒 βž–
assertron πŸ’» compile 🟑 TS1259-a-t 🟑 TS1259-a-t 🟑 TS1259-a-t βž–
πŸƒ runtime 🟑 🟑 🟑 βž–
cjs πŸ’» compile 🟒 🟒 🟒 βž–
πŸƒ runtime 🟒 🟒 🟒 βž–
es-cjs πŸ’» compile 🟒 🟒 🟒 βž–
πŸƒ runtime 🟒 🟒 🟒 βž–
esm πŸ’» compile βž– βž– βž– βž–
πŸƒ runtime βž– βž– βž– βž–
esm-cjs πŸ’» compile 🟒 🟒 🟒 βž–
πŸƒ runtime ❌ Error-6 ❌ Error-7 ❌ Error-8 βž–
named-cjs πŸ’» compile βž– βž– 🟒 🟒
πŸƒ runtime βž– βž– 🟒 🟒
named-es-cjs πŸ’» compile βž– βž– 🟒 🟒
πŸƒ runtime βž– βž– 🟒 🟒
named-esm πŸ’» compile βž– βž– βž– βž–
πŸƒ runtime βž– βž– βž– βž–
named-esm-cjs πŸ’» compile βž– βž– 🟒 🟒
πŸƒ runtime βž– βž– 🟒 🟒
param-case πŸ’» compile πŸ”΄ TS1259-a-1 πŸ”΄ TS1259-a-1 πŸ”΄ TS2497-a βž–
πŸƒ runtime πŸ”΄ type-not-fn-1 πŸ”΄ type-not-fn-1 🟑 βž–
  • TS1259-a: Module '"assert"' can only be default-imported using the 'allowSyntheticDefaultImports' flag
  • TS1259-a-1: Module '"/home/homa/code/cyberuni/ts-esm-interop/node_modules/.pnpm/param-case@1.1.2/node_modules/param-case/param-case"' can only be default-imported using the 'allowSyntheticDefaultImports' flag
  • TS1259-a-t: Module '"/home/homa/code/cyberuni/ts-esm-interop/node_modules/.pnpm/assertion-error@1.1.0/node_modules/assertion-error/index"' can only be default-imported using the 'allowSyntheticDefaultImports' flag
  • TS1259-e: Module '"assert"' can only be default-imported using the 'esModuleInterop' flag
  • TS1259-e-1: Module '"/home/homa/code/cyberuni/ts-esm-interop/node_modules/.pnpm/param-case@1.1.2/node_modules/param-case/param-case"' can only be default-imported using the 'esModuleInterop' flag
  • TS1259-e-t: Module '"/home/homa/code/cyberuni/ts-esm-interop/node_modules/.pnpm/assertion-error@1.1.0/node_modules/assertion-error/index"' can only be default-imported using the 'esModuleInterop' flag
  • TS2497-a: This module can only be referenced with ECMAScript imports/exports by turning on the 'allowSyntheticDefaultImports' flag and referencing its default export.
  • TS2497-e: This module can only be referenced with ECMAScript imports/exports by turning on the 'esModuleInterop' flag and referencing its default export.
  • Error: `Command failed: node esm-cjs.default-as.all.js node:internal/modules/cjs/loader:535 throw e; ^

Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: No "exports" main defined in /home/homa/code/cyberuni/ts-esm-interop/tests/node/node_modules/esm-cjs/package.json at new NodeError (node:internal/errors:393:5) at throwExportsNotFound (node:internal/modules/esm/resolve:358:9) at packageExportsResolve (node:internal/modules/esm/resolve:612:7) at resolveExports (node:internal/modules/cjs/loader:529:36) at Module._findPath (node:internal/modules/cjs/loader:569:31) at Module._resolveFilename (node:internal/modules/cjs/loader:981:27) at Module._load (node:internal/modules/cjs/loader:841:27) at Module.require (node:internal/modules/cjs/loader:1061:19) at require (node:internal/modules/cjs/helpers:103:18) at Object. (/home/homa/code/cyberuni/ts-esm-interop/tests/node/commonjs/esm-cjs.default-as.all.js:3:19) { code: 'ERR_PACKAGE_PATH_NOT_EXPORTED' }

Node.js v18.12.1 `

  • Error-1: `Command failed: node esm-cjs.default.all.js node:internal/modules/cjs/loader:535 throw e; ^

Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: No "exports" main defined in /home/homa/code/cyberuni/ts-esm-interop/tests/node/node_modules/esm-cjs/package.json at new NodeError (node:internal/errors:393:5) at throwExportsNotFound (node:internal/modules/esm/resolve:358:9) at packageExportsResolve (node:internal/modules/esm/resolve:612:7) at resolveExports (node:internal/modules/cjs/loader:529:36) at Module._findPath (node:internal/modules/cjs/loader:569:31) at Module._resolveFilename (node:internal/modules/cjs/loader:981:27) at Module._load (node:internal/modules/cjs/loader:841:27) at Module.require (node:internal/modules/cjs/loader:1061:19) at require (node:internal/modules/cjs/helpers:103:18) at Object. (/home/homa/code/cyberuni/ts-esm-interop/tests/node/commonjs/esm-cjs.default.all.js:3:19) { code: 'ERR_PACKAGE_PATH_NOT_EXPORTED' }

Node.js v18.12.1 `

  • Error-2: `Command failed: node esm-cjs.star.all.js node:internal/modules/cjs/loader:535 throw e; ^

Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: No "exports" main defined in /home/homa/code/cyberuni/ts-esm-interop/tests/node/node_modules/esm-cjs/package.json at new NodeError (node:internal/errors:393:5) at throwExportsNotFound (node:internal/modules/esm/resolve:358:9) at packageExportsResolve (node:internal/modules/esm/resolve:612:7) at resolveExports (node:internal/modules/cjs/loader:529:36) at Module._findPath (node:internal/modules/cjs/loader:569:31) at Module._resolveFilename (node:internal/modules/cjs/loader:981:27) at Module._load (node:internal/modules/cjs/loader:841:27) at Module.require (node:internal/modules/cjs/loader:1061:19) at require (node:internal/modules/cjs/helpers:103:18) at Object. (/home/homa/code/cyberuni/ts-esm-interop/tests/node/commonjs/esm-cjs.star.all.js:3:11) { code: 'ERR_PACKAGE_PATH_NOT_EXPORTED' }

Node.js v18.12.1 `

  • Error-3: `Command failed: node esm-cjs.default-as.all.js node:internal/modules/cjs/loader:535 throw e; ^

Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: No "exports" main defined in /home/homa/code/cyberuni/ts-esm-interop/tests/node/node_modules/esm-cjs/package.json at new NodeError (node:internal/errors:393:5) at throwExportsNotFound (node:internal/modules/esm/resolve:358:9) at packageExportsResolve (node:internal/modules/esm/resolve:612:7) at resolveExports (node:internal/modules/cjs/loader:529:36) at Module._findPath (node:internal/modules/cjs/loader:569:31) at Module._resolveFilename (node:internal/modules/cjs/loader:981:27) at Module._load (node:internal/modules/cjs/loader:841:27) at Module.require (node:internal/modules/cjs/loader:1061:19) at require (node:internal/modules/cjs/helpers:103:18) at Object. (/home/homa/code/cyberuni/ts-esm-interop/tests/node/node16/esm-cjs.default-as.all.js:3:19) { code: 'ERR_PACKAGE_PATH_NOT_EXPORTED' }

Node.js v18.12.1 `

  • Error-4: `Command failed: node esm-cjs.default.all.js node:internal/modules/cjs/loader:535 throw e; ^

Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: No "exports" main defined in /home/homa/code/cyberuni/ts-esm-interop/tests/node/node_modules/esm-cjs/package.json at new NodeError (node:internal/errors:393:5) at throwExportsNotFound (node:internal/modules/esm/resolve:358:9) at packageExportsResolve (node:internal/modules/esm/resolve:612:7) at resolveExports (node:internal/modules/cjs/loader:529:36) at Module._findPath (node:internal/modules/cjs/loader:569:31) at Module._resolveFilename (node:internal/modules/cjs/loader:981:27) at Module._load (node:internal/modules/cjs/loader:841:27) at Module.require (node:internal/modules/cjs/loader:1061:19) at require (node:internal/modules/cjs/helpers:103:18) at Object. (/home/homa/code/cyberuni/ts-esm-interop/tests/node/node16/esm-cjs.default.all.js:3:19) { code: 'ERR_PACKAGE_PATH_NOT_EXPORTED' }

Node.js v18.12.1 `

  • Error-5: `Command failed: node esm-cjs.star.all.js node:internal/modules/cjs/loader:535 throw e; ^

Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: No "exports" main defined in /home/homa/code/cyberuni/ts-esm-interop/tests/node/node_modules/esm-cjs/package.json at new NodeError (node:internal/errors:393:5) at throwExportsNotFound (node:internal/modules/esm/resolve:358:9) at packageExportsResolve (node:internal/modules/esm/resolve:612:7) at resolveExports (node:internal/modules/cjs/loader:529:36) at Module._findPath (node:internal/modules/cjs/loader:569:31) at Module._resolveFilename (node:internal/modules/cjs/loader:981:27) at Module._load (node:internal/modules/cjs/loader:841:27) at Module.require (node:internal/modules/cjs/loader:1061:19) at require (node:internal/modules/cjs/helpers:103:18) at Object. (/home/homa/code/cyberuni/ts-esm-interop/tests/node/node16/esm-cjs.star.all.js:3:11) { code: 'ERR_PACKAGE_PATH_NOT_EXPORTED' }

Node.js v18.12.1 `

  • Error-6: `Command failed: node esm-cjs.default-as.all.js node:internal/modules/cjs/loader:535 throw e; ^

Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: No "exports" main defined in /home/homa/code/cyberuni/ts-esm-interop/tests/node/node_modules/esm-cjs/package.json at new NodeError (node:internal/errors:393:5) at throwExportsNotFound (node:internal/modules/esm/resolve:358:9) at packageExportsResolve (node:internal/modules/esm/resolve:612:7) at resolveExports (node:internal/modules/cjs/loader:529:36) at Module._findPath (node:internal/modules/cjs/loader:569:31) at Module._resolveFilename (node:internal/modules/cjs/loader:981:27) at Module._load (node:internal/modules/cjs/loader:841:27) at Module.require (node:internal/modules/cjs/loader:1061:19) at require (node:internal/modules/cjs/helpers:103:18) at Object. (/home/homa/code/cyberuni/ts-esm-interop/tests/node/nodenext/esm-cjs.default-as.all.js:3:19) { code: 'ERR_PACKAGE_PATH_NOT_EXPORTED' }

Node.js v18.12.1 `

  • Error-7: `Command failed: node esm-cjs.default.all.js node:internal/modules/cjs/loader:535 throw e; ^

Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: No "exports" main defined in /home/homa/code/cyberuni/ts-esm-interop/tests/node/node_modules/esm-cjs/package.json at new NodeError (node:internal/errors:393:5) at throwExportsNotFound (node:internal/modules/esm/resolve:358:9) at packageExportsResolve (node:internal/modules/esm/resolve:612:7) at resolveExports (node:internal/modules/cjs/loader:529:36) at Module._findPath (node:internal/modules/cjs/loader:569:31) at Module._resolveFilename (node:internal/modules/cjs/loader:981:27) at Module._load (node:internal/modules/cjs/loader:841:27) at Module.require (node:internal/modules/cjs/loader:1061:19) at require (node:internal/modules/cjs/helpers:103:18) at Object. (/home/homa/code/cyberuni/ts-esm-interop/tests/node/nodenext/esm-cjs.default.all.js:3:19) { code: 'ERR_PACKAGE_PATH_NOT_EXPORTED' }

Node.js v18.12.1 `

  • Error-8: `Command failed: node esm-cjs.star.all.js node:internal/modules/cjs/loader:535 throw e; ^

Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: No "exports" main defined in /home/homa/code/cyberuni/ts-esm-interop/tests/node/node_modules/esm-cjs/package.json at new NodeError (node:internal/errors:393:5) at throwExportsNotFound (node:internal/modules/esm/resolve:358:9) at packageExportsResolve (node:internal/modules/esm/resolve:612:7) at resolveExports (node:internal/modules/cjs/loader:529:36) at Module._findPath (node:internal/modules/cjs/loader:569:31) at Module._resolveFilename (node:internal/modules/cjs/loader:981:27) at Module._load (node:internal/modules/cjs/loader:841:27) at Module.require (node:internal/modules/cjs/loader:1061:19) at require (node:internal/modules/cjs/helpers:103:18) at Object. (/home/homa/code/cyberuni/ts-esm-interop/tests/node/nodenext/esm-cjs.star.all.js:3:11) { code: 'ERR_PACKAGE_PATH_NOT_EXPORTED' }

Node.js v18.12.1 `

  • syntax: Cannot use import statement outside a module
  • type-not-fn: (0 , assert_1.default) is not a function
  • type-not-fn-1: (0 , param_case_1.default) is not a function

Test Subjects

Depends on the test configuration, the way to consume a module are different.

In this section we describe each module and how they are consumed within this configuration.

assert.default-as.all.ts:

import { default as assert } from 'assert'

assert(true)

assert.default.all.ts:

import assert from 'assert'

assert(true)

assert.star.all.ts:

import * as assert from 'assert'

assert(true)

assertron.default-as.all.ts:

import { default as assertron } from 'assertron'

assertron.truthy(true)

assertron.default.all.ts:

import assertron from 'assertron'

assertron.truthy(true)

assertron.star.all.ts:

import * as assertron from 'assertron'

assertron.default.truthy(true)

cjs.default-as.all.ts:

import { default as m } from 'cjs'

m()

cjs.default.all.ts:

import m from 'cjs'

m()

cjs.star.all.ts:

import * as m from 'cjs'

m.default()

es-cjs.default-as.all.ts:

import { default as m } from 'es-cjs'

m()

es-cjs.default.all.ts:

import m from 'es-cjs'

m()

es-cjs.star.all.ts:

import * as m from 'es-cjs'

m.default()

esm-cjs.default-as.all.ts:

import { default as m } from 'esm-cjs'

m()

esm-cjs.default.all.ts:

import m from 'esm-cjs'

m()

esm-cjs.star.all.ts:

import * as m from 'esm-cjs'

m.default()

named-cjs.named.all.ts:

import { greet } from 'named-cjs'

greet()

named-cjs.star.all.ts:

import * as m from 'named-cjs'

m.greet()

named-es-cjs.named.all.ts:

import { greet } from 'named-es-cjs'

greet()

named-es-cjs.star.all.ts:

import * as m from 'named-es-cjs'

m.greet()

named-esm-cjs.named.all.ts:

import { greet } from 'named-esm-cjs'

greet()

named-esm-cjs.star.all.ts:

import * as m from 'named-esm-cjs'

m.greet()

param-case.default-as.all.ts:

import { default as paramCase } from 'param-case'

paramCase('hello world')

param-case.default.all.ts:

import paramCase from 'param-case'

paramCase('hello world')

param-case.star.all.ts:

import * as paramCase from 'param-case'

paramCase('hello world')