nhn / tui.editor

🍞📝 Markdown WYSIWYG Editor. GFM Standard + Chart & UML Extensible.
http://ui.toast.com/tui-editor
MIT License
16.99k stars 1.72k forks source link

There is an error when select table cell #2537

Open jiayoujun opened 2 years ago

jiayoujun commented 2 years ago

There is an error when select table cell

In my nextjs project. I want to select mul cell in table,then an error: TypeError: Class constructor Selection cannot be invoked without 'new'. This has nothing to do with this plugin---@toast-ui/editor-plugin-table-merged-cell. I had this problem using basic features.

Reproduce / Screenshots

TuiEditor问题2022662014511

My project info:

 "dependencies": {
    "@toast-ui/editor-plugin-chart": "^3.0.1",
    "@toast-ui/editor-plugin-code-syntax-highlight": "^3.0.0",
    "@toast-ui/editor-plugin-color-syntax": "^3.0.3",
    "@toast-ui/editor-plugin-table-merged-cell": "^3.0.2",
    "@toast-ui/editor-plugin-uml": "^3.0.1",
    "@toast-ui/react-editor": "^3.1.7",
    "axios": "^0.27.2",
    "html-react-parser": "^1.4.14",
    "next": "^12.1.7-canary.29",
    "prismjs": "^1.28.0",
    "quill-better-table": "^1.2.10",
    "react": "18.1.0",
    "react-dom": "18.1.0",
    "react-quill": "^2.0.0-beta.4",
    "sharp": "^0.28.3",
    "styled-components": "^5.3.5"
  },
  "devDependencies": {
    "@types/node": "17.0.35",
    "@types/react": "18.0.9",
    "@types/react-dom": "18.0.5",
    "eslint": "8.16.0",
    "eslint-config-next": "12.1.6",
    "typescript": "4.7.2"
  },
  "resolutions": {
    "prosemirror-model": "1.17.0",
    "prosemirror-view": "1.18.1"
  },

Device info:

error screenshot

image

jwlee1108 commented 2 years ago

@jiayoujun Is it on SSR env? We don't support SSR yet.

liuyaxin commented 2 years ago

try use prosemirror-state with version 1.3.4 and prosemirror-transform version 1.4.2 prosemirror-state after1.3.4 ported to typescript and lead to "Class constructor Selection cannot be invoked without 'new'"

me-jser commented 11 months ago

try use prosemirror-state with version 1.3.4 and prosemirror-transform version 1.4.2 prosemirror-state after1.3.4 ported to typescript and lead to "Class constructor Selection cannot be invoked without 'new'"

works for me ! thx

ghost commented 9 months ago

Hi everyone! After adding prosemirror-state and prosemirror-transform problem with runtime error was resolved, but I have one more problem - wrong paste table. Does anybody have this problem? Or maybe anybody knows how it fix?

https://github.com/nhn/tui.editor/assets/133666945/7c538b63-eb1c-4e6e-9e37-1d1e2345acb0

Markdown after paste in table:

| test1 | test2 |  |
| ----- | ----- | --- |
| test1 |
| test3 |

|  |
| --- |
| test3 |
BVBFD commented 8 months ago

Hello ~ I also have same problem like the obove. I am using originally node v20.9.0. So, after installing NVM and downgrade the node version as v16.19.0. and then, it works.

hope that it will be helpful to another one having the same issues~

Polymorphy12 commented 3 months ago

try use prosemirror-state with version 1.3.4 and prosemirror-transform version 1.4.2 prosemirror-state after1.3.4 ported to typescript and lead to "Class constructor Selection cannot be invoked without 'new'"

How does this work? Should I add them to package.json dependencies, or resolutions?

I'm currently using yarn package manager.