adminjs-expressjs icon indicating copy to clipboard operation
adminjs-expressjs copied to clipboard

fix:err_package_path_not_exported error in typescript

Open dev-josias opened this issue 1 year ago • 4 comments

admin express errror

I fixed the error by adding "require" field to the "exports" field in package.json.

dev-josias avatar Apr 22 '24 11:04 dev-josias

AdminJS packages are ESM-only. Require exports are omitted on purpose

dziraf avatar Apr 22 '24 12:04 dziraf

AdminJS packages are ESM-only. Require exports are omitted on purpose

Without that I can't get it to work in my typescript project. I tried all kind of configurations in tsconfig without success. That was the thing that finally did it for me.

dev-josias avatar Apr 22 '24 12:04 dev-josias

set module to nodenext and remove moduleResolution, your project must be esm compatible though

dziraf avatar Apr 22 '24 12:04 dziraf

Still won't work. I had to switch to bun.js. It's working without issues now.

dev-josias avatar May 04 '24 10:05 dev-josias