Missing "types" field in package.json exports

Hi!

I’m using @mobiscroll/angular-ivy version 5.29.0 with the latest Angular version.

In my tsconfig.json of my Angular application I recently decided to use moduleResolution: Bundler.

This breaks mobiscroll because in the package.json of @mobiscroll/angular-ivy it’s missing the types field in the exports of the main entry point.

This is the patch that fixes it:

diff --git a/node_modules/@mobiscroll/angular-ivy/package.json b/node_modules/@mobiscroll/angular-ivy/package.json
index c57c450..1c9226e 100644
--- a/node_modules/@mobiscroll/angular-ivy/package.json
+++ b/node_modules/@mobiscroll/angular-ivy/package.json
@@ -30,6 +30,7 @@
   "exports": {
     ".": {
       "import": "./dist/esm5/mobiscroll.angular.min.js",
+      "types": "./dist/js/mobiscroll.angular.min.d.ts",
       "require": "./dist/js/mobiscroll.angular.min.js"
     },
     "./dist/css/*": "./dist/css/*",

Basically in the package.json inside the exports field in the main entry point (.) the following line should be added:

"types": "./dist/js/mobiscroll.angular.min.d.ts"

I’m aware that if one currently creates a new Angular application, the moduleResolution is set to node and there is no error, but in the next Angular major version (18), the default will be moduleResolution: Bundler:

Adding the line I’m proposing in the package.json won’t break any existing Angular application that uses moduleResolution: node, but by adding that line, Mobiscroll will work with both module resolutions (Bundle, node and even NodeNext/Node16).

Hi @Josep_Ponsati :wave:

Thanks for reporting and sorry about the trouble!

We will have to look into this a bit deeper and investigate it.
I’ll let you know about what we have found.