ProseMirror / prosemirror

The ProseMirror WYSIWYM editor
http://prosemirror.net/
MIT License
7.62k stars 336 forks source link

error TS2709: Cannot use namespace ‘OrderedMap’ as a type #1326

Closed dimsis closed 1 year ago

dimsis commented 1 year ago

Hello,

We are using Telerik's angular-kendo-editor which is using prosemirror library: https://www.telerik.com/kendo-angular-ui/components/editor/plugins/ Our project is still using Angular 11.

Suddenly from 28/10/2022 we start getting these error messages while trying to build: ERROR in node_modules/@types/prosemirror-model/index.d.ts:1132:40 - error TS2709: Cannot use namespace ‘OrderedMap’ as a type.

1132 nodes: { [name in N]: NodeSpec } | OrderedMap; ~~ node_modules/@types/prosemirror-model/index.d.ts:1139:41 - error TS2709: Cannot use namespace ‘OrderedMap’ as a type.

1139 marks?: { [name in M]: MarkSpec } | OrderedMap | null | undefined; ~~ node_modules/@types/prosemirror-schema-list/index.d.ts:44:40 - error TS2709: Cannot use namespace ‘OrderedMap’ as a type.

44 nodes: { [name in N]: NodeSpec } | OrderedMap, ~~ node_modules/@types/prosemirror-schema-list/index.d.ts:47:81 - error TS2709: Cannot use namespace ‘OrderedMap’ as a type.

47 ): { [name in (N | “ordered_list” | “bullet_list” | “list_item”)]: NodeSpec } | OrderedMap;

The prosemirror dependencies appear to be derived from us using the: “@progress/kendo-angular-editor”: “^2.5.0”,

What has been an upstream change or something and we are getting those errors and how can we fix it please?

Kind regards, Dimitris

marijnh commented 1 year ago

Can you somehow set things up to use the types in orderedmap itself, instead of the @types package?

dimsis commented 1 year ago

On Tue, 1 Nov 2022 at 14:50, Marijn Haverbeke @.***> wrote:

Can you somehow set things up to use the types in orderedmap itself, instead of the @types package?

— Reply to this email directly, view it on GitHub https://github.com/ProseMirror/prosemirror/issues/1326#issuecomment-1298540992, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAIHJJUJ6GPDWJAPESXOXLWGEN3PANCNFSM6AAAAAARTGYEUM . You are receiving this because you authored the thread.Message ID: @.***>

Hi

Any clues how I can do this?

tshantan24 commented 1 year ago

Updating the version of @progress/kendo-angular-editor resolved the issue for us.

dimsis commented 1 year ago

Updating the version of @progress/kendo-angular-editor resolved the issue for us.

This cannot help in our case, since we cannot also upgade Angular version at the moment and even 3.1.2 which is the latest version of kendo-editor for Angular 11, is throwing the same error. "orderedmap": "1.1.5" in package.json solved the problem

Thanks

dbarrerap commented 1 year ago

Not sure if ngx-editor or prose-mirror uses this as a dependency, but adding "orderedmap":"^1.1.7" next to all the dependencies fixes the issue, as stated by @dimsis . (I am aware now that there is a 1.1.8)

belotesagar commented 1 year ago

I am using angular 6 and suddenly our build gets failed due to this error. can anyone tells me why I am getting this error.

kejriwalayushi commented 1 year ago

I am using angular 8, tried adding orderedmap to package.json, doesn't work for me. Can anyone help me here?

kejriwalayushi commented 1 year ago

Not sure if ngx-editor or prose-mirror uses this as a dependency, but adding "orderedmap":"^1.1.7" next to all the dependencies fixes the issue, as stated by @dimsis . (I am aware now that there is a 1.1.8)

Can you provide a screenshot of your package.json, which version of angular are you using?

marijnh commented 1 year ago

Recent versions no longer use namespace in their type declarations, so indeed, removing your package lock or otherwise upgrading orderedmap will definitely solve this.

dimsis commented 1 year ago

I am using Angular 10 and in the dependencies of package.json it works with: "orderedmap": "1.1.5", Don't forget to npm i