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

Fix ra-input-rich-text dependencies on tiptap #8622

Merged
merged 6 commits into from
Feb 9, 2023

Conversation

slax57
Copy link
Contributor

@slax57 slax57 commented Feb 6, 2023

Problem

Our sandboxes are broken again because of a BC in tiptap dependencies management: https://github.com/ueberdosis/tiptap/releases/tag/v2.0.0-beta.210

ERROR in ./node_modules/@tiptap/core/dist/index.js 150:0-152:26
Module not found: Error: Can't resolve '@tiptap/pm/state' in '/home/projects/pariavaxz.github/node_modules/@tiptap/core/dist'
 @ ./node_modules/@tiptap/react/dist/index.js 35:0-52 36:27-37 225:0-227:22 284:34-42 425:0-29 425:0-29
 @ ./node_modules/ra-input-rich-text/dist/esm/RichTextInput.js 15:0-57 84:17-26 142:32-45
 @ ./node_modules/ra-input-rich-text/dist/esm/index.js 1:0-32 1:0-32
 @ ./src/posts/PostCreate.tsx 14:0-51 71:32-45
 @ ./src/posts/index.tsx 2:0-38 8:12-22
 @ ./src/index.tsx 13:0-28 20:71-76

Solution

This PR bumps the tiptap deps to their latest version, and also applies the new recommendations: remove prosemirror-* deps and add @tiptap/pm to the deps.

Results

Current sandbox

https://stackblitz.com/github/marmelab/react-admin/tree/master/examples/simple?file=README.md

Fixed sandbox

https://stackblitz.com/edit/github-8fm95g-e2nqwd

@slax57 slax57 added WIP Work In Progress DNM labels Feb 6, 2023
@StefanFl
Copy link

StefanFl commented Feb 7, 2023

https://github.com/ueberdosis/tiptap/releases/tag/v2.0.0-beta.213 might be the fix you are waiting for.

@fzaninotto
Copy link
Member

This fails because of yet another breaking change: ueberdosis/tiptap#3694

@fzaninotto
Copy link
Member

fzaninotto commented Feb 8, 2023

I updated to the latest beta.216, but the codesandbox https://codesandbox.io/s/github/marmelab/react-admin/tree/fix-tiptap-deps-again/examples/simple showes new errors:

RROR in ./node_modules/@tiptap/core/dist/index.js 1:0-107
Module not found: Error: Can't resolve '@tiptap/pm/state' in '/sandbox/node_modules/@tiptap/core/dist'
 @ ./node_modules/@tiptap/react/dist/index.js 3:0-60 4:0-29 4:0-29 32:21-29 233:28-36
 @ ./node_modules/ra-input-rich-text/dist/esm/RichTextInput.js 15:0-57 84:17-26 142:32-45
 @ ./node_modules/ra-input-rich-text/dist/esm/index.js 1:0-32 1:0-32
 @ ./src/posts/PostCreate.tsx 14:0-51 71:32-45
 @ ./src/posts/index.tsx 2:0-38 8:12-22
 @ ./src/index.tsx 13:0-28 20:71-76

ERROR in ./node_modules/@tiptap/core/dist/index.js 2:0-45
Module not found: Error: Can't resolve '@tiptap/pm/view' in '/sandbox/node_modules/@tiptap/core/dist'
 @ ./node_modules/@tiptap/react/dist/index.js 3:0-60 4:0-29 4:0-29 32:21-29 233:28-36
 @ ./node_modules/ra-input-rich-text/dist/esm/RichTextInput.js 15:0-57 84:17-26 142:32-45
 @ ./node_modules/ra-input-rich-text/dist/esm/index.js 1:0-32 1:0-32
 @ ./src/posts/PostCreate.tsx 14:0-51 71:32-45
 @ ./src/posts/index.tsx 2:0-38 8:12-22
 @ ./src/index.tsx 13:0-28 20:71-76

ERROR in ./node_modules/@tiptap/core/dist/index.js 3:0-43
Module not found: Error: Can't resolve '@tiptap/pm/keymap' in '/sandbox/node_modules/@tiptap/core/dist'
 @ ./node_modules/@tiptap/react/dist/index.js 3:0-60 4:0-29 4:0-29 32:21-29 233:28-36
 @ ./node_modules/ra-input-rich-text/dist/esm/RichTextInput.js 15:0-57 84:17-26 142:32-45
 @ ./node_modules/ra-input-rich-text/dist/esm/index.js 1:0-32 1:0-32
 @ ./src/posts/PostCreate.tsx 14:0-51 71:32-45
 @ ./src/posts/index.tsx 2:0-38 8:12-22
 @ ./src/index.tsx 13:0-28 20:71-76

ERROR in ./node_modules/@tiptap/core/dist/index.js 4:0-101
Module not found: Error: Can't resolve '@tiptap/pm/model' in '/sandbox/node_modules/@tiptap/core/dist'
 @ ./node_modules/@tiptap/react/dist/index.js 3:0-60 4:0-29 4:0-29 32:21-29 233:28-36
 @ ./node_modules/ra-input-rich-text/dist/esm/RichTextInput.js 15:0-57 84:17-26 142:32-45
 @ ./node_modules/ra-input-rich-text/dist/esm/index.js 1:0-32 1:0-32
 @ ./src/posts/PostCreate.tsx 14:0-51 71:32-45
 @ ./src/posts/index.tsx 2:0-38 8:12-22
 @ ./src/index.tsx 13:0-28 20:71-76

ERROR in ./node_modules/@tiptap/core/dist/index.js 5:0-126
Module not found: Error: Can't resolve '@tiptap/pm/transform' in '/sandbox/node_modules/@tiptap/core/dist'
 @ ./node_modules/@tiptap/react/dist/index.js 3:0-60 4:0-29 4:0-29 32:21-29 233:28-36
 @ ./node_modules/ra-input-rich-text/dist/esm/RichTextInput.js 15:0-57 84:17-26 142:32-45
 @ ./node_modules/ra-input-rich-text/dist/esm/index.js 1:0-32 1:0-32
 @ ./src/posts/PostCreate.tsx 14:0-51 71:32-45
 @ ./src/posts/index.tsx 2:0-38 8:12-22
 @ ./src/index.tsx 13:0-28 20:71-76

ERROR in ./node_modules/@tiptap/core/dist/index.js 6:0-589
Module not found: Error: Can't resolve '@tiptap/pm/commands' in '/sandbox/node_modules/@tiptap/core/dist'
 @ ./node_modules/@tiptap/react/dist/index.js 3:0-60 4:0-29 4:0-29 32:21-29 233:28-36
 @ ./node_modules/ra-input-rich-text/dist/esm/RichTextInput.js 15:0-57 84:17-26 142:32-45
 @ ./node_modules/ra-input-rich-text/dist/esm/index.js 1:0-32 1:0-32
 @ ./src/posts/PostCreate.tsx 14:0-51 71:32-45
 @ ./src/posts/index.tsx 2:0-38 8:12-22
 @ ./src/index.tsx 13:0-28 20:71-76

ERROR in ./node_modules/@tiptap/core/dist/index.js 7:0-132
Module not found: Error: Can't resolve '@tiptap/pm/schema-list' in '/sandbox/node_modules/@tiptap/core/dist'
 @ ./node_modules/@tiptap/react/dist/index.js 3:0-60 4:0-29 4:0-29 32:21-29 233:28-36
 @ ./node_modules/ra-input-rich-text/dist/esm/RichTextInput.js 15:0-57 84:17-26 142:32-45
 @ ./node_modules/ra-input-rich-text/dist/esm/index.js 1:0-32 1:0-32
 @ ./src/posts/PostCreate.tsx 14:0-51 71:32-45
 @ ./src/posts/index.tsx 2:0-38 8:12-22
 @ ./src/index.tsx 13:0-28 20:71-76

ERROR in ./node_modules/@tiptap/extension-bubble-menu/dist/index.js 2:0-53
Module not found: Error: Can't resolve '@tiptap/pm/state' in '/sandbox/node_modules/@tiptap/extension-bubble-menu/dist'
 @ ./node_modules/@tiptap/react/dist/index.js 1:0-65 18:23-39
 @ ./node_modules/ra-input-rich-text/dist/esm/RichTextInput.js 15:0-57 84:17-26 142:32-45
 @ ./node_modules/ra-input-rich-text/dist/esm/index.js 1:0-32 1:0-32
 @ ./src/posts/PostCreate.tsx 14:0-51 71:32-45
 @ ./src/posts/index.tsx 2:0-38 8:12-22
 @ ./src/index.tsx 13:0-28 20:71-76

ERROR in ./node_modules/@tiptap/extension-bubble-menu/dist/index.js 3:0-39
Module not found: Error: Can't resolve 'lodash/debounce' in '/sandbox/node_modules/@tiptap/extension-bubble-menu/dist'
Did you mean 'debounce.js'?
BREAKING CHANGE: The request 'lodash/debounce' failed to resolve only because it was resolved as fully specified
(probably because the origin is strict EcmaScript Module, e. g. a module with javascript mimetype, a '*.mjs' file, or a '*.js' file where the package.json contains '"type": "module"').
The extension in the request is mandatory for it to be fully specified.
Add the extension to the request.
 @ ./node_modules/@tiptap/react/dist/index.js 1:0-65 18:23-39
 @ ./node_modules/ra-input-rich-text/dist/esm/RichTextInput.js 15:0-57 84:17-26 142:32-45
 @ ./node_modules/ra-input-rich-text/dist/esm/index.js 1:0-32 1:0-32
 @ ./src/posts/PostCreate.tsx 14:0-51 71:32-45
 @ ./src/posts/index.tsx 2:0-38 8:12-22
 @ ./src/index.tsx 13:0-28 20:71-76

ERROR in ./node_modules/@tiptap/extension-code-block/dist/index.js 2:0-68
Module not found: Error: Can't resolve '@tiptap/pm/state' in '/sandbox/node_modules/@tiptap/extension-code-block/dist'
 @ ./node_modules/@tiptap/starter-kit/dist/index.js 6:0-57 39:28-47
 @ ./node_modules/ra-input-rich-text/dist/esm/RichTextInput.js 16:0-45 150:8-18
 @ ./node_modules/ra-input-rich-text/dist/esm/index.js 1:0-32 1:0-32
 @ ./src/posts/PostCreate.tsx 14:0-51 71:32-45
 @ ./src/posts/index.tsx 2:0-38 8:12-22
 @ ./src/index.tsx 13:0-28 20:71-76

ERROR in ./node_modules/@tiptap/extension-dropcursor/dist/index.js 2:0-51
Module not found: Error: Can't resolve '@tiptap/pm/dropcursor' in '/sandbox/node_modules/@tiptap/extension-dropcursor/dist'
 @ ./node_modules/@tiptap/starter-kit/dist/index.js 8:0-58 45:28-48
 @ ./node_modules/ra-input-rich-text/dist/esm/RichTextInput.js 16:0-45 150:8-18
 @ ./node_modules/ra-input-rich-text/dist/esm/index.js 1:0-32 1:0-32
 @ ./src/posts/PostCreate.tsx 14:0-51 71:32-45
 @ ./src/posts/index.tsx 2:0-38 8:12-22
 @ ./src/index.tsx 13:0-28 20:71-76

ERROR in ./node_modules/@tiptap/extension-floating-menu/dist/index.js 2:0-53
Module not found: Error: Can't resolve '@tiptap/pm/state' in '/sandbox/node_modules/@tiptap/extension-floating-menu/dist'
 @ ./node_modules/@tiptap/react/dist/index.js 6:0-69 145:23-41
 @ ./node_modules/ra-input-rich-text/dist/esm/RichTextInput.js 15:0-57 84:17-26 142:32-45
 @ ./node_modules/ra-input-rich-text/dist/esm/index.js 1:0-32 1:0-32
 @ ./src/posts/PostCreate.tsx 14:0-51 71:32-45
 @ ./src/posts/index.tsx 2:0-38 8:12-22
 @ ./src/index.tsx 13:0-28 20:71-76

ERROR in ./node_modules/@tiptap/extension-gapcursor/dist/index.js 2:0-49
Module not found: Error: Can't resolve '@tiptap/pm/gapcursor' in '/sandbox/node_modules/@tiptap/extension-gapcursor/dist'
 @ ./node_modules/@tiptap/starter-kit/dist/index.js 9:0-56 48:28-47
 @ ./node_modules/ra-input-rich-text/dist/esm/RichTextInput.js 16:0-45 150:8-18
 @ ./node_modules/ra-input-rich-text/dist/esm/index.js 1:0-32 1:0-32
 @ ./src/posts/PostCreate.tsx 14:0-51 71:32-45
 @ ./src/posts/index.tsx 2:0-38 8:12-22
 @ ./src/index.tsx 13:0-28 20:71-76

ERROR in ./node_modules/@tiptap/extension-history/dist/index.js 2:0-57
Module not found: Error: Can't resolve '@tiptap/pm/history' in '/sandbox/node_modules/@tiptap/extension-history/dist'
 @ ./node_modules/@tiptap/starter-kit/dist/index.js 12:0-52 57:28-45
 @ ./node_modules/ra-input-rich-text/dist/esm/RichTextInput.js 16:0-45 150:8-18
 @ ./node_modules/ra-input-rich-text/dist/esm/index.js 1:0-32 1:0-32
 @ ./src/posts/PostCreate.tsx 14:0-51 71:32-45
 @ ./src/posts/index.tsx 2:0-38 8:12-22
 @ ./src/index.tsx 13:0-28 20:71-76

ERROR in ./node_modules/@tiptap/extension-horizontal-rule/dist/index.js 2:0-49
Module not found: Error: Can't resolve '@tiptap/pm/state' in '/sandbox/node_modules/@tiptap/extension-horizontal-rule/dist'
 @ ./node_modules/@tiptap/starter-kit/dist/index.js 13:0-67 60:28-52
 @ ./node_modules/ra-input-rich-text/dist/esm/RichTextInput.js 16:0-45 150:8-18
 @ ./node_modules/ra-input-rich-text/dist/esm/index.js 1:0-32 1:0-32
 @ ./src/posts/PostCreate.tsx 14:0-51 71:32-45
 @ ./src/posts/index.tsx 2:0-38 8:12-22
 @ ./src/index.tsx 13:0-28 20:71-76

@fzaninotto fzaninotto added RFR Ready For Review and removed WIP Work In Progress DNM labels Feb 9, 2023
@fzaninotto
Copy link
Member

It seems we're finally good with version 217! https://codesandbox.io/p/sandbox/sweet-parm-eu2286

@fzaninotto fzaninotto modified the milestones: 4.8.0, 4.7.5 Feb 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
RFR Ready For Review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants