Ngx-mask: Angular 5.0.1 -- Possible Bug

Created on 13 Nov 2017  路  21Comments  路  Source: JsDaddy/ngx-mask

When in the html is inserted the mask, I have this error that does not let my component be loaded, linking to another InjectionToken error, and when I remove the mask everything works.

below the image of the same.

Erro no HTML
captura de tela de 2017-11-12 23-47-30

InjectionToken
captura de tela de 2017-11-12 23-49-47

Most helpful comment

@vgildeev Thanks so much! I was frustratingly close in my attempted fix!

@NepipenkoIgor would you consider implementing this fix? resolves all AOT issues on my end as well

All 21 comments

@ThalesMatoso Thank you . I will check

Ok, waiting, I believe is @angular/http has to be deprecated is you using in app.module, but I do not know working on plugin ...

has prevision? my project have dependecy on plugin

Sorry my english, I'm training whitout translator.

@ThalesMatoso 小ould you provide more info or make some test project?

i try insert mask at input text, after update angular 5, all librarys work with success, exception ngx-mask

I remove mask at input text bellow and project well its work fine
mask="00.000.000/0000

i believe is library @angular/http because now is deprecated

What information is most needed, i can help you?

@ThalesMatoso @NepipenkoIgor I've spent a now disgusting amount of time trying to figure out what was breaking my app... see the post above for some detail... I think the fix is straightforward and will take a look at it after confirming all else is functional now that my app loads again... will update this post shortly

further edit- AOT is still broken, config has no value regardless of how one tries to set it. dev/JIT works as it whould

Good, i try again reinstall plugin on my project after update to 2.1.17, but not have success.

follow more details below
Version Plugin 2.1.17
captura de tela de 2017-11-25 17-30-24

After update with npm install
captura de tela de 2017-11-25 17-35-12

Error on console and mask-service.js
captura de tela de 2017-11-25 17-29-16

it is error on mask-service.js
captura de tela de 2017-11-25 17-28-50

is my organization.component.html
captura de tela de 2017-11-25 17-29-42

Sorry but not have @angular/http installed @angular/http, because angular 5 is deprecated. But is necessary or am i mistaki?

Thank you for attention.

Hi, I'm experiencing the same problem with Cannot read property 'map' of undefined. It's working fine in JIT mode but failed in AOT mode.
I'm using angular v5.0.2 along with reactive forms and running my project with this command: ng serve --aot.
Cannot provide test project because I didn't find any online editor which allows me to run angular app in aot mode.

@vgildeev I'm having the same issue, 2.17 made JIT work for me, even passing the defaults as forRoot() params in my module doesn't allow AOT to work, config is always undefined in MaskService

@caseyPav i did not understand, but more detail please?

@ThalesMatoso I don't have much to add sadly- when built AOT the config injectiontoken is always undefined, which causes the app to break. In AOT the default or specified masking rules never get set as they are not being passed.

I agree, but aot on new version Angular aot is default. i dont know how to do. Solutions?

I've forked this lib and fixed this issue. Here you can see a fix just in case you might need it too :).

@vgildeev Thanks so much! I was frustratingly close in my attempted fix!

@NepipenkoIgor would you consider implementing this fix? resolves all AOT issues on my end as well

I can confirm that resolved the AOT and Prod flag issue on my end as well

It's work! Thank You @vgildeev

Maybe we should keep this open until the fixes get merged into master branch, for visibility purpose.

@NepipenkoIgor This issue is closed but the solution @vgildeev gave still not implemented in this repo.

@Shadayy Thanks , i will try reproduce @vgildeev problem

@NepipenkoIgor I fixed this issue by doing NgxMaskModule.forRoot() in my app.module (it was missing the .forRoot() ).
I'm running the 2.2.2 version

@Shadayy Awesome, then think i can close this issue

I'm getting the same issue. in ^2.4.4

If I provide MaskService in component level, the error is gone. If I provide MaskService submodule or root module level, I'm getting the same error.

Is this mandatory to provide it component level?

[Note: I'm using lazy loading]

Was this page helpful?
0 / 5 - 0 ratings

Related issues

cabbott65 picture cabbott65  路  4Comments

Et3rnal picture Et3rnal  路  4Comments

renanBritz picture renanBritz  路  3Comments

tanjuyayak picture tanjuyayak  路  3Comments

humpedli picture humpedli  路  3Comments