JsDaddy / ngx-mask

Angular Plugin to make masks on form fields and html elements.
https://jsdaddy.github.io/ngx-mask
MIT License
1.15k stars 298 forks source link

v14.3.0 causing build errors - exports not found #1230

Closed Achilles1515 closed 1 year ago

Achilles1515 commented 1 year ago

Example build errors:

Error: export 'MaskApplierService' (imported as 'i5') was not found in 'ngx-mask' (possible exports: INITIAL_CONFIG, NEW_CONFIG, NGX_MASK_CONFIG, NgxMaskDirective, NgxMaskPipe, NgxMaskService, initialConfig, provideEnvironmentNgxMask, provideNgxMask, timeMasks, withoutValidation)
Error: export 'NgxMaskModule' (imported as 'NgxMaskModule') was not found in 'ngx-mask'

Looking at the ngx-mask/index.d.ts for 14.3.0, it looks like:

export * from './lib/ngx-mask.providers';
export * from './lib/ngx-mask.directive';
export * from './lib/ngx-mask.pipe';
export * from './lib/ngx-mask.service';
export * from './lib/ngx-mask.config';

The previous v14 package, 14.2.4, looks like:

export * from './lib/ngx-mask.module';
export * from './lib/mask.directive';
export * from './lib/mask.pipe';
export * from './lib/mask.service';
export * from './lib/mask-applier.service';
export * from './lib/config';
export * from './lib/custom-keyboard-event';

Clearly, NgxMaskModule is gone now. I'm assuming this is unintended as the README states:

Quickstart if ngx-mask version < 15.0.0 ... @NgModule({ imports: [ NgxMaskModule.forRoot(), ], })

bfrikken commented 1 year ago

This is exactly what we are seeing today as well.

Alex18gr commented 1 year ago

We have important release and and I have the same issue. We are ruined....

Achilles1515 commented 1 year ago

We have important release and and I have the same issue. We are ruined....

Sorry about your release; everything will be okay though. Until there is a fix: If ngx-mask is being used by a dependency of your app, then add this to your package.json:

"overrides": {
    "ngx-mask@14.3.0": "14.2.4"
}

Otherwise, just edit the ngx-mask version directly in your package.json dependencies if it is included there.

andriikamaldinov1 commented 1 year ago

@Achilles1515 @Alex18gr @bfrikken Thanks for using Ngx-mask. We have updated version 14 with all the fixes that were in version 16. But we didn't change documentation. Documentation will be updated soon, we apologize for the inconvenience The new version of how to use version 14.3.0 is below with stackblitz examples. import { NgxMaskDirective, NgxMaskPipe, provideNgxMask } from 'ngx-mask';

imports: [CommonModule, RouterModule, NgxMaskDirective, NgxMaskPipe], providers: [provideNgxMask()],

bootstrapApplication - https://stackblitz.com/edit/angular-14-demo-pwh413?file=src%2Fapp%2Fapp.component.html,src%2Fapp%2Fapp.component.ts,src%2Fmain.ts,src%2Froutes.ts

bootstrapModule - https://stackblitz.com/edit/angular-14-demo-adnanx?file=src%2Fapp%2Fapp.component.ts,src%2Fmain.ts,src%2Fapp%2Fapp.module.ts,src%2Fapp%2Fapp.component.html

kronox98 commented 1 year ago

@Achilles1515 @Alex18gr @bfrikken Thanks for using Ngx-mask. We have updated version 14 with all the fixes that were in version 16. But we didn't change documentation. Documentation will be updated soon, we apologize for the inconvenience The new version of how to use version 14.3.0 is below with stackblitz examples. import { NgxMaskDirective, NgxMaskPipe, provideNgxMask } from 'ngx-mask';

imports: [CommonModule, RouterModule, NgxMaskDirective, NgxMaskPipe], providers: [provideNgxMask()],

bootstrapApplication - https://stackblitz.com/edit/angular-14-demo-pwh413?file=src%2Fapp%2Fapp.component.html,src%2Fapp%2Fapp.component.ts,src%2Fmain.ts,src%2Froutes.ts

bootstrapModule - https://stackblitz.com/edit/angular-14-demo-adnanx?file=src%2Fapp%2Fapp.component.ts,src%2Fmain.ts,src%2Fapp%2Fapp.module.ts,src%2Fapp%2Fapp.component.html

Hello, I have the following error when I try to follow the steps in the stackblitz example

./node_modules/ngx-mask/fesm2022/ngx-mask.mjs:1670:9-33 - Error: export 'makeEnvironmentProviders' (imported as 'makeEnvironmentProviders') was not found in '@angular/core'

I am using "@angular/core": "^14.2.11" .

ttwoosta commented 1 year ago

Hello,

Thank you for sharing the Stackbliz projects. Although, it work fine on Stackbliz platform, but it complie failed on my local. I'm using Node.js v18.20 that give me an error.

image

andriikamaldinov1 commented 1 year ago

@Achilles1515 @Alex18gr @bfrikken Please upgrade to version 14.3.2 , we have returned the modules. Everything should work as expected. It example - https://stackblitz.com/edit/angular-14-demo-jvp7px?file=src%2Fapp%2Fapp.component.ts,src%2Fmain.ts,src%2Fapp%2Fapp.module.ts,src%2Fapp%2Fapp.component.html

Can you test it on your projects and let us know if everything is ok?

andriikamaldinov1 commented 1 year ago

@Achilles1515 @Alex18gr @bfrikken Thanks for using Ngx-mask. Closed because in the new version everything works as expected, if there are problems open a new issue.