tui.editor icon indicating copy to clipboard operation
tui.editor copied to clipboard

There is an error when select table cell

Open jiayoujun opened this issue 2 years ago • 6 comments

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:

  • Device: [PC]
  • OS: [win 11]
  • Browser [google chrome]

error screenshot

image

jiayoujun avatar Jun 06 '22 12:06 jiayoujun

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

jwlee1108 avatar Jun 22 '22 02:06 jwlee1108

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'"

liuyaxin avatar Jul 16 '22 06:07 liuyaxin

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

me-jser avatar Aug 15 '23 09:08 me-jser

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 |

ghost avatar Nov 03 '23 08:11 ghost

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~

BVBFD avatar Nov 10 '23 10:11 BVBFD