Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: recurring error after updating to angular 15: ngx-editor Property 'pmViewDesc' must be of type 'ViewDesc', but here has type 'ViewDesc' #469

Closed
Fiehra opened this issue Apr 29, 2023 · 5 comments

Comments

@Fiehra
Copy link

Fiehra commented Apr 29, 2023

What happened?

after updating my projects angular version to v15 the build keeps crashing. it is caused by a package which is used by ngx-editor (prosemirror-view). when checking resolved issues to see if maybe someone experienced the same issue i found a ticket with the exact same error message but in angular version 13. i updated ngx-editor to latest version (currently v15.3.0) to see if it will fix the error as proposed in the ticket, but the build keeps crashing. we cant use this build in our project if this persists. has anyone else experienced this error aswell? any pointers to fixing the build are much appreciated!

Version

v15.3.0

Angular Version

v15.2.8

What browsers are you seeing the problem on?

No response

Link to reproduce

No response

Relevant log output

Error: 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', but here has type 'ViewDesc'.

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

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


** Angular Live Development Server is listening on localhost:4200, open your browser on http://localhost:4200/ **


✖ Failed to compile.

Willing to submit a PR?

None

@jmbarbier
Copy link

I added those resolutions to package.json (same as ngx-editor devDependencies), cleared node_modules, yarn.lock or package-lock.json. The build works, but the downside is to remember updating those resolutions in sync with ngx-editor evolutions.

"resolutions": {
    "prosemirror-codemirror-6": "^1.0.0",
    "prosemirror-commands": "^1.5.0",
    "prosemirror-history": "^1.3.0",
    "prosemirror-inputrules": "^1.2.0",
    "prosemirror-keymap": "^1.2.1",
    "prosemirror-model": "^1.19.0",
    "prosemirror-schema-list": "^1.2.2",
    "prosemirror-state": "^1.4.2",
    "prosemirror-view": "^1.30.1"
  }

@sibiraj-s
Copy link
Owner

Sorry for the delay in response.

I believe there is no need to use resolutions. Just deleting the node_modules and package-lock.json and reinstalling should do. And, you should check the typescript version required(minimum).

Also, this is not with the library itself, it is because of some conflicting package version or with typescript mismatch during upgrades.

@jakyle
Copy link

jakyle commented May 16, 2023

image
Hello! I'm also running into the same issue in ngx-editor@13.0.0

"typescript": "4.5.2"
"@angular/cdk": "13.3.2",
"@angular/common": "13.2.0",
"@angular/compiler": "13.2.0",
"@angular/core": "13.2.0",
"@angular/forms": "13.2.0",
"@angular/material": "13.3.2",
"@angular/platform-browser": "13.2.0",
"@angular/platform-browser-dynamic": "13.2.0",

I also deleted my yarn.lock, removed my node_modules and completely reinstalled the package, still no good.

@sibiraj-s
Copy link
Owner

Sorry I missed this. You must also check the tsconfig.json configuration. You can refer the project setup for any, this happens mostly after an update I guess. There isn't much I could do here as there is no bug in the editor.

Some things to check

  • delete lock file and node_modules directory to avoid duplicated package installs overtime
  • verify typescript version
  • verify tsconfig

these should resolve the issue. You can refer the code in this repo in projects/demo folder its already working.

Closing this as I couldn't do much here. This problem occurred for several people in the past, the above solution worked for everyone. Hope that solves your issue too.

Thanks.

@github-actions
Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 20, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants