SoftwareBrothers / adminjs-design-system

DesignSystem on which AdminJS is based on
27 stars 33 forks source link

Pinned `tiptap` dependencies result in TypeScript compilation errors #62

Closed alecgibson closed 1 year ago

alecgibson commented 1 year ago

The tiptap dependencies were pinned (ie the ^ semver operator was removed) in https://github.com/SoftwareBrothers/adminjs-design-system/commit/32ec6f5a08cf62b9183fdc5f22320ba6ed48434d

One of the downstream effects of this is that the resolved packages have multiple different dependencies on different versions of prosemirror-view, which then causes a TypeScript compilation error due to the different versions of prosemirror-view:

node_modules/@tiptap/core/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-view/dist/index.d.ts:215:9
    215         pmViewDesc?: ViewDesc;
                ~~~~~~~~~~
    'pmViewDesc' was also declared here.

Found 1 error in node_modules/@tiptap/core/node_modules/prosemirror-view/dist/index.d.ts:215

This was an issue in @tiptap/extension-table (also having pinned requirements), which has since been fixed. However, we don't get this fix because the version of @tiptap/extension-table has been pinned in this repo.

igordelorenzi commented 1 year ago

Temporary fix:

package.json

{
  ...,
  "overrides": {
    "prosemirror-view": "^1.28.2"
  }
}

Tip: if npm install throws some sort of error, try to run npm dedupe. Particularly, it solved my problem.