sibiraj-s / ngx-editor

🖋️ Rich Text Editor for angular using ProseMirror
https://sibiraj-s.github.io/ngx-editor/
MIT License
457 stars 191 forks source link

[Bug]: Error with types #494

Closed LopezSantiago closed 1 year ago

LopezSantiago commented 1 year ago

What happened?

The library has error with trusted-types/lib and prosemirror-view libraries I created a new angular project and only add the library in latest version and crashed. I guess the problem is with the "prosemirror-view": "1.31.6", I changed the version to 1.36.7 and added @types/trusted-types and the problem dissapeared.

Version

16.0.0

Angular Version

16.2.0

What browsers are you seeing the problem on?

No response

Link to reproduce

No response

Relevant log output

Error: node_modules/ngx-editor/lib/pipes/sanitize/sanitize-html.pipe.d.ts:3:29 - error TS2307: Cannot find module 'trusted-types/lib' or its corresponding type declarations.

3 import { TrustedHTML } from 'trusted-types/lib';
                              ~~~~~~~~~~~~~~~~~~~

Error: node_modules/ngx-editor/lib/trustedTypesUtil.d.ts:1:55 - error TS2307: Cannot find module 'trusted-types/lib' or its corresponding type declarations.    

Error: node_modules/ngx-editor/node_modules/prosemirror-view/dist/index.d.ts:215:9 - error TS2717: Subsequent property declarations must have the same type.  Property 'pmViewDesc' must be of type 'ViewDesc | undefined', but here has type 'ViewDesc | undefined'.

215         pmViewDesc?: ViewDesc;
            ~~~~~~~~~~

  node_modules/prosemirror-view/dist/index.d.ts:215:9
    215         pmViewDesc?: ViewDesc;
                ~~~~~~~~~~
    'pmViewDesc' was also declared here.

Willing to submit a PR?

None

sibiraj-s commented 1 year ago

Okay. Regarding trusted-types It should be added to dependencies. The other is just something happens during upgrade often I guess, and it has nothing to do with the editor.

See here for steps to resolve it https://github.com/sibiraj-s/ngx-editor/issues/469#issuecomment-1636771997

sibiraj-s commented 1 year ago

Should be fixed in v16.0.1

github-actions[bot] commented 1 year ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in the thread.