angular / angular-cli

CLI tool for Angular
https://cli.angular.io
MIT License
26.73k stars 11.98k forks source link

not able to use ngx-contextmenu for angular 9 #16720

Closed TaruniSurampally closed 4 years ago

TaruniSurampally commented 4 years ago

I was using ngx-contextmenu library with angular 8 and it was working fine. i have upgraded my version of angular from angular 8 to angular 9. Now, ngx-contextmenu is not working.

It throws the following error: ERROR in ./node_modules/ngx-contextmenu/ivy_ngcc__/fesm5/ngx-contextmenu.js 454:16-24 "export 'Renderer' was not found in '@angular/core' ERROR in ./node_modules/ngx-contextmenu/ivy_ngcc/fesm5/ngx-contextmenu.js 476:304-312 "export 'Renderer' was not found in '@angular/core' ERROR in ./node_modules/ngx-contextmenu/__ivy_ngcc/fesm5/ngx-contextmenu.js 511:26-34 "export 'Renderer' was not found in '@angular/core'

ERROR in node_modules/ngx-contextmenu/lib/contextMenuContent.component.d.ts:3:56 - error TS2724: Module '"../../@angular/core/core"' has no exported member 'Renderer'. Did you mean 'Renderer2'?

3 import { AfterViewInit, ChangeDetectorRef, ElementRef, Renderer } from '@angular/core';
                                                         ~~~~~~~~

  node_modules/@angular/core/core.d.ts:5680:31
    5680 export declare abstract class Renderer2 {
                                       ~~~~~~~~~
    'Renderer2' is declared here.

When upgraded from angular 8 to angular 9 (for Renderer): this was update for Renderer that happened Renderer to Renderer2 migration. As of Angular 9, the Renderer class is no longer available. Renderer2 should be used instead. Read more about this here: https://v9.angular.io/guide/migration-renderer Migration completed. successfull

Is ngx-contextmenu library not supported in angular 9? https://www.npmjs.com/package/ngx-contextmenu

Is there any other alternate library that we can use for contextmenu in angular9

clydin commented 4 years ago

The Renderer class has be been deprecated since Angular v4 and was removed in v9. For the package to support Angular v9, the package would need to use the Renderer2 class instead.

It also appears that the latest version of the package has attempted to correct the issue (5.3.0) via https://github.com/isaacplmann/ngx-contextmenu/pull/179

If this version does not correct the problem, please consider opening an issue with the project directly: https://github.com/isaacplmann/ngx-contextmenu/issues

angular-automatic-lock-bot[bot] commented 4 years ago

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.