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]: node_modules/@tiptap/core/dist/NodeView.d.ts:31:5 - error TS2416: Property 'ignoreMutation' in type 'NodeView<Component, NodeEditor, Options>' #5867

Closed
1 task done
seybi79 opened this issue Nov 26, 2024 · 5 comments
Labels
Category: Open Source The issue or pull reuqest is related to the open source packages of Tiptap. Type: Bug The issue or pullrequest is related to a bug

Comments

@seybi79
Copy link

seybi79 commented Nov 26, 2024

Affected Packages

tip tap core

Version(s)

2.10.2

Bug Description

When I build my application getting below error
node_modules/@tiptap/core/dist/NodeView.d.ts:31:5 - error TS2416: Property 'ignoreMutation' in type 'NodeView<Component, NodeEditor, Options>' is not assignable to the same property in base type 'NodeView'.
Type '(mutation: MutationRecord | { type: "selection"; target: Element; }) => boolean' is not assignable to type '(mutation: ViewMutationRecord) => boolean'.
Types of parameters 'mutation' and 'mutation' are incompatible.
Type 'ViewMutationRecord' is not assignable to type 'MutationRecord | { type: "selection"; target: Element; }'.
Type '{ type: "selection"; target: Node; }' is not assignable to type 'MutationRecord | { type: "selection"; target: Element; }'.
Type '{ type: "selection"; target: Node; }' is not assignable to type '{ type: "selection"; target: Element; }'.
Types of property 'target' are incompatible.
Type 'Node' is missing the following properties from type 'Element': attributes, classList, className, clientHeight, and 118 more.

31 ignoreMutation(mutation: MutationRecord | {
~~~~~~~~~~~~~~

Browser Used

Chrome

Code Example URL

No response

Expected Behavior

Build without fail..

Additional Context (Optional)

No response

Dependency Updates

  • Yes, I've updated all my dependencies.
@seybi79 seybi79 added Category: Open Source The issue or pull reuqest is related to the open source packages of Tiptap. Type: Bug The issue or pullrequest is related to a bug labels Nov 26, 2024
@nperez0111
Copy link
Contributor

I think this is probably a change on the prosemirror side, but honestly you probably should not be type checking your lib files, with skipLibCheck: true in your TS config

@nperez0111
Copy link
Contributor

Yep changed here: ProseMirror/prosemirror-view@cebd804

@gasfab999
Copy link

I also faced this issue when integrating it into my angular repo. I could also reproduce it in a newly created angular repo on stackblitz https://stackblitz.com/edit/stackblitz-starters-3n6y2x?file=src%2Fmain.ts

@nperez0111
Copy link
Contributor

I also faced this issue when integrating it into my angular repo. I could also reproduce it in a newly created angular repo on stackblitz stackblitz.com/edit/stackblitz-starters-3n6y2x?file=src%2Fmain.ts

I fixed your sandbox with "skipLibCheck": true, see it here: https://stackblitz.com/edit/stackblitz-starters-pyzqxr?file=tsconfig.json

Really should not be type checking library code, not just for perf but minor incompatibilities like this.

@gasfab999
Copy link

@nperez0111 I get you point. But it seems in angular repos for example this seem to be enabled by default.

Can confirm that "skipLibCheck": true also fixed it for me in my repo, thx 👍

@nperez0111 nperez0111 mentioned this issue Nov 26, 2024
5 tasks
rajsite added a commit to ni/nimble that referenced this issue Dec 4, 2024
# Pull Request

## 🤨 Rationale

Updates dependencies manually to address build issues revealed by #2482
#2481 #2480.
Found that just updating dependencies by rebuilding the lock fails the
build which means the [repo is in a bad
state](#1479 (comment))
and that should be addressed quickly.

## 👩‍💻 Implementation

- Update major deps and rebuild lock
- Found that the now [deprecated tiptap link
validate](https://tiptap.dev/docs/editor/extensions/marks/link#validate-deprecated)
function is expected to still function with [backwards
compat](ueberdosis/tiptap#5812) however there
seems to be a regression as it [fails our build by allowing autolinking
of unexpected
protocols](https://github.com/ni/nimble/actions/runs/12110590706/job/33761233944#step:17:613).
- Switched from tiptap link validate to
[shouldAutoLink](https://tiptap.dev/docs/editor/extensions/marks/link#shouldautolink)
as described by docs. That seems to not fail the build.
- Pushed the min semver range version up for all the tiptap /
prosemirror packages as otherwise it seems to[ fail build when type
checking libraries](ueberdosis/tiptap#5867).
   
**NOTE**: It seems to be transitive dependency type issues that will
fail builds, I think it's possible that minimal upgrades done by
renovate may hit issues in app updates. If an app adopting latest these
changes fails to build it may need to rebuild the lock files in a clean
workspace to align transitive deps on latest versions and avoid library
type check issues.
- Updates to [prettier
3.4](https://prettier.io/blog/2024/11/26/3.4.0.html) resulting in lots
of changes.

## 🧪 Testing

Rely on CI.

## ✅ Checklist

- [x] I have updated the project documentation to reflect my changes or
determined no changes are needed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category: Open Source The issue or pull reuqest is related to the open source packages of Tiptap. Type: Bug The issue or pullrequest is related to a bug
Projects
None yet
Development

No branches or pull requests

3 participants