effect icon indicating copy to clipboard operation
effect copied to clipboard

moduleResolution "Node16" breaks importing inside modules (.mts or package.json type: "module")

Open patroza opened this issue 3 years ago • 0 comments

https://github.com/patroza/ts-node16-resolution-test/blob/master/_src/sync-test.mts Because of missing type entries in package.json exports

Could not find a declaration file for module '@effect-ts/core/Sync'. 'node16-test/node_modules/@effect-ts/core/_mjs/Sync/index.mjs' implicitly has an 'any' type.
  If the '@effect-ts/core' package actually exposes this module, try adding a new declaration (.d.ts) file containing `declare module '@effect-ts/core/Sync';

Changing all exports entries like so fixes it:

    "./XPure/XState": {
      "import": {
        "types": "./XPure/XState/index.d.ts",
        "default": "./_mjs/XPure/XState/index.mjs"
      },
      "require": "./XPure/XState/index.js"
    },

patroza avatar Jun 22 '22 10:06 patroza