PeterStaev / nativescript-masked-text-field

:hash: A NativeScript Masked Text Field widget
Apache License 2.0
25 stars 24 forks source link

Ivy compiler issues #50

Open aosi87 opened 3 years ago

aosi87 commented 3 years ago

I was trying to use this plugin with NS7 and angular 10, i was able to install every other dependency but this one.

Looks like everything works if we do not use Angular Ivy compiler

I've created ngcc.config.ts

module.exports = {
    "packages": {
        "nativescript-masked-text-field": {
            entryPoints: {
                "angular": {
                    override: {
                        main: "./index.js",
                        typings: "./index.d.ts",
                    },
                    ignoreMissingDependencies: true,
                }
            },
            ignorableDeepImportMatchers: [
                /tns-core-modules\//,
                /@nativescript\/core\//,
                /@nativescript\/angular\//,
                /nativescript-angular\//,
                /nativescript-angular\/forms\//,
                /@angular\/core\//,
                /@angular\/forms\//,
            ]
        }
    }
}

Add added a post-install script in package.json "postinstall": "ngcc --properties es2015 browser module main --first-only --create-ivy-entry-points"

ERROR

ERROR in node_modules/nativescript-masked-text-field/angular/index.d.ts:1:22 - error NG6002: Appears in the NgModule.imports of ClaimsModule, but could not be resolved to an NgModule class.

This likely means that the library (nativescript-masked-text-field/angular) which declares MaskedTextFieldModule has not been processed correctly by ngcc, or is not compatible with Angular Ivy. Check if a newer version of the library is available, and update if so. Also consider checking with the library's authors to see if the library is expected to be compatible with Ivy.

1 export declare class MaskedTextFieldModule

But still cannot make it work. Do you have any plans to update this plugin to work with NS7 and Angular9+

NOTE: i cannot use @proplugins/nativescript-masked-text-field 'cause requries a subscription that my team cannot use or do right now.

PeterStaev commented 3 years ago

Hey @aosi87 , as written in the readme all future work of the plugin will be done under ProPlugins. If you do not want to subscribe, then you are free to fork the public repo and make the code compatible with latest NS/NG. I'm also happily accepting PRs đŸ˜ƒ