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

Adding link via toolbar is broken in 3.2.0 #2671

Closed
whendon opened this issue Aug 13, 2022 · 13 comments
Closed

Adding link via toolbar is broken in 3.2.0 #2671

whendon opened this issue Aug 13, 2022 · 13 comments
Labels

Comments

@whendon
Copy link

whendon commented Aug 13, 2022

Describe the bug

I am unable to add a link in wysiwyg mode - after typing the values into the fields and pressing "OK", I get this error in the console:

index.js:19269 Uncaught ReferenceError: getCustomAttrs is not defined
    at Object.toDOM (index.js:19269:36)
    at MarkViewDesc.create (index.js:1118:117)
    at ViewTreeUpdater.syncToMarks (index.js:1699:45)
    at eval (index.js:1268:21)
    at iterDeco (index.js:1898:13)
    at NodeViewDesc.updateChildren (index.js:1258:9)
    at NodeViewDesc.updateInner (index.js:1355:18)
    at NodeViewDesc.update (index.js:1347:14)
    at ViewTreeUpdater.updateNextNode (index.js:1775:37)
    at eval (index.js:1276:30)

And I've managed to track down the error to this file

To Reproduce

Steps to reproduce the behavior:

  1. Create a new editor with default options
  2. Click the toolbar button to add a link
  3. Fill out fields, press OK, observe error (link does not appear, and error appears in console)

Expected behavior

Link toolbar button works

Screenshots

I took some screenshots of index.js where the error was occurring, the issue seems to be due to compiling at some point.
The defined function is getCustomAttrs$1() but is being called as getCustomAttrs()
g2048
g2058

Desktop (please complete the following information):

  • OS: Windows
  • Browser: Brave/Chromium
  • Version: Brave v1.42.88 Chromium 104.0.5112.81

Additional context

My environment: vuejs application
Vuejs 2.6.11
I am not using the vue-editor wrapper
Other toolbar buttons work as intended, I am having no other issues with the editor so far.

@whendon whendon added the Bug label Aug 13, 2022
@Cypherball
Copy link

I'm facing the same issue.
Downgrading to version 3.1.10 is the only fix

@jooy2
Copy link

jooy2 commented Aug 19, 2022

I also had the same problem.
However, downgrading the version did not solve the problem.

@Cypherball
Copy link

I also had the same problem. However, downgrading the version did not solve the problem.

Check the version installed in your package-lock; you may have to fix the version 3.1.10 instead of ^3.1.10

@jooy2
Copy link

jooy2 commented Aug 19, 2022

Unfortunately, the problem persisted even after deleting and reinstalling node_modules and package-lock.json to match the 3.1.0 version.

image

When I newly installed and opened the package-json.lock file, it was as follows.

    "node_modules/@toast-ui/editor": {
      "version": "3.2.0",
      "resolved": "https://registry.npmjs.org/@toast-ui/editor/-/editor-3.2.0.tgz",
      "integrity": "sha512-lEvbBSbvz5MvmTGHoDAYkco5B1os9C8B0IJmSj/iLmjSFQCtku1g4hFG4jKzTju9e+5wTosbDa3aYHAJAZK/QA==",
      "dependencies": {
        "dompurify": "^2.3.3",
        "prosemirror-commands": "^1.1.9",
        "prosemirror-history": "^1.1.3",
        "prosemirror-inputrules": "^1.1.3",
        "prosemirror-keymap": "^1.1.4",
        "prosemirror-model": "^1.14.1",
        "prosemirror-state": "^1.3.4",
        "prosemirror-view": "^1.18.7"
      }
    },
    "node_modules/@toast-ui/editor-plugin-table-merged-cell": {
      "version": "3.1.0",
      "resolved": "https://registry.npmjs.org/@toast-ui/editor-plugin-table-merged-cell/-/editor-plugin-table-merged-cell-3.1.0.tgz",
      "integrity": "sha512-9ch9h1heTs0Kkmhwpb1ef9psQSM77wvUO3J75BsHv3RO5nAug42W3HC4Y+qbX5n1z1VhOGGjuOb4GPIr8s5dRA=="
    },
    "node_modules/@toast-ui/react-editor": {
      "version": "3.1.10",
      "resolved": "https://registry.npmjs.org/@toast-ui/react-editor/-/react-editor-3.1.10.tgz",
      "integrity": "sha512-IY9uEIVKsOcWHuGf4kn08xILudhhNBbp3tGEvhpxpmhWiuFDKuEVBhTk/sUmFR4pytNefcvNi9wjzWU2BcYD+Q==",
      "dependencies": {
        "@toast-ui/editor": "^3.1.10"
      },
      "peerDependencies": {
        "react": "^17.0.1"
      }
    },

However, one strange thing is that the package-lock.json shows a version that is not pointed to.

node_modules/@toast-ui/editor = 3.2.0
node_modules/@toast-ui/react-editor = 3.1.0

Is there anything more I can check?

@Cypherball
Copy link

@jooy2 Problem is in the dependency list of @toast-ui/react-editor (see in package-lock): "@toast-ui/editor": "^3.1.10"
install this in package.json by fixing the version also...

I'm also on NextJS and this was fixed for me

@Shimon42
Copy link

For peoples working with React in a Docker container, here is what worked for me

  • remove "@toast-ui/react-editor" from "peerDependencies", if present in your package.json
  • In your DockerFile use -> RUN npm install @toast-ui/editor@3.1.10 @toast-ui/react-editor@3.1.10

@jooy2
Copy link

jooy2 commented Aug 20, 2022

@Cypherball @Shimon42

Thank you all!
In my case, I was able to solve it by installing version 3.1.10 of @toast-ui/editor that was not added to package.json.

▽▽▽▽ package.json ▽▽▽▽

    "@toast-ui/editor": "3.1.10",
    "@toast-ui/editor-plugin-table-merged-cell": "3.1.0",
    "@toast-ui/react-editor": "3.1.10",

Anyway, I hope this issue has been forwarded to the TUI development team and resolved as soon as possible.

@ChangHyun2
Copy link

I modified package.json, but it still throws an error. @jooy2

package.json

    "@toast-ui/chart": "^4.4.1",
    "@toast-ui/react-editor": "3.1.10",
    "@toast-ui/editor": "3.1.10",
    "@toast-ui/editor-plugin-table-merged-cell": "3.1.0",

yarn.lock

"@toast-ui/chart@^4.4.1":
  version "4.4.3"
  resolved "https://registry.yarnpkg.com/@toast-ui/chart/-/chart-4.4.3.tgz#e3a5e00a1ce542cbefdba4ae6238828ccef5e7eb"
  integrity sha512-lvv4g39uwl1DmsdlfrLxSf/qCGus7fDwWrWGlc5w9rcBidrWjZyFNmzfQC0Y/VycOPJR6YqfgPyY59R6+5eBsw==

"@toast-ui/editor-plugin-table-merged-cell@3.1.0":
  version "3.1.0"
  resolved "https://registry.yarnpkg.com/@toast-ui/editor-plugin-table-merged-cell/-/editor-plugin-table-merged-cell-3.1.0.tgz#86422e2bc0dc2becf956aa7fa6cc5b45031e9611"
  integrity sha512-9ch9h1heTs0Kkmhwpb1ef9psQSM77wvUO3J75BsHv3RO5nAug42W3HC4Y+qbX5n1z1VhOGGjuOb4GPIr8s5dRA==

"@toast-ui/editor@3.1.10":
  version "3.1.10"
  resolved "https://registry.yarnpkg.com/@toast-ui/editor/-/editor-3.1.10.tgz#11022bee8c8c8b80300eb556ac051b23c2c20f86"
  integrity sha512-lzJxNM9lEbAxEqVAnLGqARLFqcVAPW3gwVOU0qKHf/IIwdhjZPjo8VDNQ4sPqOsC7vKCG35HVX8bNC+ab+Gzlg==
  dependencies:
    dompurify "^2.3.3"
    prosemirror-commands "~1.1.9"
    prosemirror-history "~1.1.3"
    prosemirror-inputrules "~1.1.3"
    prosemirror-keymap "~1.1.4"
    prosemirror-model "~1.14.1"
    prosemirror-state "~1.3.4"
    prosemirror-transform "~1.3.0"
    prosemirror-view "~1.18.7"

"@toast-ui/editor@^3.1.10":
  version "3.2.0"
  resolved "https://registry.yarnpkg.com/@toast-ui/editor/-/editor-3.2.0.tgz#5c0bca0be825465fdb786b2d70aa16ab9ca09c46"
  integrity sha512-lEvbBSbvz5MvmTGHoDAYkco5B1os9C8B0IJmSj/iLmjSFQCtku1g4hFG4jKzTju9e+5wTosbDa3aYHAJAZK/QA==
  dependencies:
    dompurify "^2.3.3"
    prosemirror-commands "^1.1.9"
    prosemirror-history "^1.1.3"
    prosemirror-inputrules "^1.1.3"
    prosemirror-keymap "^1.1.4"
    prosemirror-model "^1.14.1"
    prosemirror-state "^1.3.4"
    prosemirror-view "^1.18.7"

"@toast-ui/react-editor@3.1.10":
  version "3.1.10"
  resolved "https://registry.yarnpkg.com/@toast-ui/react-editor/-/react-editor-3.1.10.tgz#d5f62fa223190cea04f40eb6ef2aea1bae33ba6d"
  integrity sha512-IY9uEIVKsOcWHuGf4kn08xILudhhNBbp3tGEvhpxpmhWiuFDKuEVBhTk/sUmFR4pytNefcvNi9wjzWU2BcYD+Q==
  dependencies:
    "@toast-ui/editor" "^3.1.10"

@jooy2
Copy link

jooy2 commented Aug 29, 2022

I modified package.json, but it still throws an error. @jooy2

package.json

    "@toast-ui/chart": "^4.4.1",
    "@toast-ui/react-editor": "3.1.10",
    "@toast-ui/editor": "3.1.10",
    "@toast-ui/editor-plugin-table-merged-cell": "3.1.0",

yarn.lock

"@toast-ui/chart@^4.4.1":
  version "4.4.3"
  resolved "https://registry.yarnpkg.com/@toast-ui/chart/-/chart-4.4.3.tgz#e3a5e00a1ce542cbefdba4ae6238828ccef5e7eb"
  integrity sha512-lvv4g39uwl1DmsdlfrLxSf/qCGus7fDwWrWGlc5w9rcBidrWjZyFNmzfQC0Y/VycOPJR6YqfgPyY59R6+5eBsw==

"@toast-ui/editor-plugin-table-merged-cell@3.1.0":
  version "3.1.0"
  resolved "https://registry.yarnpkg.com/@toast-ui/editor-plugin-table-merged-cell/-/editor-plugin-table-merged-cell-3.1.0.tgz#86422e2bc0dc2becf956aa7fa6cc5b45031e9611"
  integrity sha512-9ch9h1heTs0Kkmhwpb1ef9psQSM77wvUO3J75BsHv3RO5nAug42W3HC4Y+qbX5n1z1VhOGGjuOb4GPIr8s5dRA==

"@toast-ui/editor@3.1.10":
  version "3.1.10"
  resolved "https://registry.yarnpkg.com/@toast-ui/editor/-/editor-3.1.10.tgz#11022bee8c8c8b80300eb556ac051b23c2c20f86"
  integrity sha512-lzJxNM9lEbAxEqVAnLGqARLFqcVAPW3gwVOU0qKHf/IIwdhjZPjo8VDNQ4sPqOsC7vKCG35HVX8bNC+ab+Gzlg==
  dependencies:
    dompurify "^2.3.3"
    prosemirror-commands "~1.1.9"
    prosemirror-history "~1.1.3"
    prosemirror-inputrules "~1.1.3"
    prosemirror-keymap "~1.1.4"
    prosemirror-model "~1.14.1"
    prosemirror-state "~1.3.4"
    prosemirror-transform "~1.3.0"
    prosemirror-view "~1.18.7"

"@toast-ui/editor@^3.1.10":
  version "3.2.0"
  resolved "https://registry.yarnpkg.com/@toast-ui/editor/-/editor-3.2.0.tgz#5c0bca0be825465fdb786b2d70aa16ab9ca09c46"
  integrity sha512-lEvbBSbvz5MvmTGHoDAYkco5B1os9C8B0IJmSj/iLmjSFQCtku1g4hFG4jKzTju9e+5wTosbDa3aYHAJAZK/QA==
  dependencies:
    dompurify "^2.3.3"
    prosemirror-commands "^1.1.9"
    prosemirror-history "^1.1.3"
    prosemirror-inputrules "^1.1.3"
    prosemirror-keymap "^1.1.4"
    prosemirror-model "^1.14.1"
    prosemirror-state "^1.3.4"
    prosemirror-view "^1.18.7"

"@toast-ui/react-editor@3.1.10":
  version "3.1.10"
  resolved "https://registry.yarnpkg.com/@toast-ui/react-editor/-/react-editor-3.1.10.tgz#d5f62fa223190cea04f40eb6ef2aea1bae33ba6d"
  integrity sha512-IY9uEIVKsOcWHuGf4kn08xILudhhNBbp3tGEvhpxpmhWiuFDKuEVBhTk/sUmFR4pytNefcvNi9wjzWU2BcYD+Q==
  dependencies:
    "@toast-ui/editor" "^3.1.10"

@ChangHyun2 Have you tried yarn install again after deleting yarn.lock and node_module folder? It seems that react-editor still points to a higher version.

@ChangHyun2
Copy link

ChangHyun2 commented Aug 30, 2022

@jooy2

if I write the @toast-ui/editor@3.1.10dependency in package.json, @toast-ui/react-editor@3.1.10 always install @toast-ui/editor@3.2.0(because peer dependency is specified by ^3.1.10).

So I moved @toast-ui/editor@3.1.10 depdency spec from "dependencies" field to "resolution" field in package.json, and @3.1.10 is installed well.

package.json

  "dependencies": {
    ...
    "@toast-ui/chart": "^4.4.3",
    "@toast-ui/react-editor": "3.1.10",
  },
  "resolutions": {
    "@toast-ui/react-editor/@toast-ui/editor": "3.1.10"
  },

yarn.lock

"@toast-ui/chart@^4.4.3":
  version "4.4.3"
  resolved "https://registry.yarnpkg.com/@toast-ui/chart/-/chart-4.4.3.tgz#e3a5e00a1ce542cbefdba4ae6238828ccef5e7eb"
  integrity sha512-lvv4g39uwl1DmsdlfrLxSf/qCGus7fDwWrWGlc5w9rcBidrWjZyFNmzfQC0Y/VycOPJR6YqfgPyY59R6+5eBsw==

"@toast-ui/editor@3.1.10", "@toast-ui/editor@^3.1.10":
  version "3.1.10"
  resolved "https://registry.yarnpkg.com/@toast-ui/editor/-/editor-3.1.10.tgz#11022bee8c8c8b80300eb556ac051b23c2c20f86"
  integrity sha512-lzJxNM9lEbAxEqVAnLGqARLFqcVAPW3gwVOU0qKHf/IIwdhjZPjo8VDNQ4sPqOsC7vKCG35HVX8bNC+ab+Gzlg==
  dependencies:
    dompurify "^2.3.3"
    prosemirror-commands "~1.1.9"
    prosemirror-history "~1.1.3"
    prosemirror-inputrules "~1.1.3"
    prosemirror-keymap "~1.1.4"
    prosemirror-model "~1.14.1"
    prosemirror-state "~1.3.4"
    prosemirror-transform "~1.3.0"
    prosemirror-view "~1.18.7"

"@toast-ui/react-editor@3.1.10":
  version "3.1.10"
  resolved "https://registry.yarnpkg.com/@toast-ui/react-editor/-/react-editor-3.1.10.tgz#d5f62fa223190cea04f40eb6ef2aea1bae33ba6d"
  integrity sha512-IY9uEIVKsOcWHuGf4kn08xILudhhNBbp3tGEvhpxpmhWiuFDKuEVBhTk/sUmFR4pytNefcvNi9wjzWU2BcYD+Q==
  dependencies:
    "@toast-ui/editor" "^3.1.10"

But when i create Editor Component, the other error(RangeError) was thrown.

image

image

+++ This error is in the other issue.
#2631

@ChangHyun2
Copy link

I edited package.json, and it works.

  "resolutions": {
    "@toast-ui/react-editor/@toast-ui/editor": "3.1.8"
  },

#2631 (comment)

@jethrolarson
Copy link
Contributor

Related: #2729

@jwlee1108
Copy link
Contributor

check v3.2.1 please, if you use react or vue wrapper, you need to use v3.2.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants