dividab / tsconfig-paths

Load node modules according to tsconfig paths, in run-time or via API.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cannot import package that uses .cjs entry

aleclarson opened this issue · comments

import 'tsconfig-paths/register'
import { open } from 'lmdb'

Error: Cannot find module '~/node_modules/lmdb/dist/index'

The exports field of lmdb looks like this:

  "type": "module",
  "main": "dist/index.cjs",
  "module": "index.js",
  "exports": {
    ".": {
      "node": {
        "require": "./dist/index.cjs",
        "import": "./node-index.js"
      },
      "default": "./index.js"
    }
  },

I can confirm that #139 fixes this issue

@aleclarson Does this work now in 3.13.0?

Yes, thank you!