sibiraj-s / ngx-editor

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

[Bug]: Error Module '"prosemirror-commands"' has no exported member 'type'. for Production #404

Closed eviv3k closed 2 years ago

eviv3k commented 2 years ago

What happened?

On production, we are facing the error Module '"prosemirror-commands"' has no exported member 'type'.

I have commented on the PR code: https://github.com/sibiraj-s/ngx-editor/commit/9e7f1ad9d58654f048962df2e82ee941b3747d5c

Version

v12.4.1

Angular Version

v13.3.

What browsers are you seeing the problem on?

No response

Link to reproduce

No response

Relevant log output

Error: node_modules/@ng-bootstrap/ng-bootstrap/util/positioning.d.ts:1:55 - error TS2307: Cannot find module '@popperjs/core' or its corresponding type declarations.

1 import { Placement as PopperPlacement, Options } from '@popperjs/core';
                                                        ~~~~~~~~~~~~~~~~

Error: node_modules/ngx-editor/lib/commands/Heading.d.ts:2:10 - error TS2305: Module '"prosemirror-commands"' has no exported member 'type'.       

2 import { type Command } from 'prosemirror-commands';
           ~~~~

Error: node_modules/ngx-editor/lib/commands/Heading.d.ts:2:15 - error TS1005: ',' expected.

2 import { type Command } from 'prosemirror-commands';
                ~~~~~~~
                ~~~~~~~~~~~

Error: node_modules/ngx-editor/lib/commands/Link.d.ts:2:10 - error TS2305: Module '"prosemirror-commands"' has no exported member 'type'.

2 import { type Command } from 'prosemirror-commands';
           ~~~~

Error: node_modules/ngx-editor/lib/commands/Link.d.ts:2:15 - error TS1005: ',' expected.

2 import { type Command } from 'prosemirror-commands';


### Willing to submit a PR?

_No response_
sibiraj-s commented 2 years ago

Strange. Works fine for me. Do you have any @types/prosemirror-* packages installed locally?

eviv3k commented 2 years ago

Oh, thank you!

I just have installed @types/prosemirror-commands (npm i @types/prosemirror-commands --save-dev)

Work fine now.

sibiraj-s commented 2 years ago

Glad the issue is fixed. But you don't have to install it manually, since its already a dependency of the package. https://github.com/sibiraj-s/ngx-editor/blob/master/projects/ngx-editor/package.json#L26

ShridharGowda commented 2 years ago

Issue resolved with version 13.0.0. Ohh man.. I struggled like anything with this issue.
Cleared npm cache, deleted node_modules folder. And Updated ngx-editor and reinstalled all packages. Now its fine.

sibiraj-s commented 2 years ago

Glad it is fixed. One of the reason, why dependencies must be pinned.

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.