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

Latest version has broken the insert URL link functionality #2687

Closed
posel opened this issue Aug 22, 2022 · 9 comments
Closed

Latest version has broken the insert URL link functionality #2687

posel opened this issue Aug 22, 2022 · 9 comments
Labels

Comments

@posel
Copy link

posel commented Aug 22, 2022

Describe the bug

After the update to the @toast-ui/editor@3.2.0 the dialog for URL link insert fails.

When started in the debug mode, The debuger raises an exception getCustomAttrs is not defined at line 19255 (in the transpilled code).

To Reproduce

Steps to reproduce the behavior:

  1. Write a text in the wysiwyg format
  2. Insert URL link filled both URL and text
  3. The link is not visible in the wysiwyg and window for insert doesn't close
  4. The link is inserted - as is visible in the mardown, but complete text is put to the text source code (to the ````txt .... ``` block)

Expected behaviour

As before update - simply insert the link

Screenshots

If applicable, add screenshots to help explain your problem.

obrazek

The OK button doesn't close the window.

However, when closed using the Cancel (Zrušit on the image), link is visible - but only in the markdown:
obrazek

Unfortunately, save fails with an exception and change is not saved. Doing again and saving without former switching to the markdown passes, but the text is converted to the string code:
obrazek

With the markdown:
obrazek

What's worse, the same problem occurs when I am trying to insert the link directly in the markdowns without using the dialog:
obrazek

it puts several ~to the code and when debugged it always fails with the error:
obrazek

and application hangs up.

Additional context

The used modules are:
aymine.com@5.56.7
├── @babel/core@7.18.10
├── @babel/plugin-proposal-class-properties@7.18.6
├── @babel/plugin-proposal-object-rest-spread@7.18.9
├── @babel/preset-env@7.18.10
├── @babel/preset-typescript@7.18.6
├── @rollup/plugin-alias@3.1.9
├── @rollup/plugin-babel@5.3.1
├── @rollup/plugin-commonjs@15.1.0
├── @rollup/plugin-node-resolve@9.0.0
├── @toast-ui/chart@4.4.3
├── @toast-ui/editor@3.2.0
├── check-dependencies@1.1.0
├── composer@4.1.0
├── npm-dts@1.3.12
├── npm@8.18.0
├── rollup-cache@1.2.0
├── rollup-plugin-terser@7.0.2
├── rollup-plugin-typescript2@0.27.3
├── rollup@2.78.1
├── tui-calendar@1.15.3
├── tui-code-snippet@2.3.3
├── tui-color-picker@2.2.8
├── tui-tree@4.0.9
└── typescript@4.7.4

@posel posel added the Bug label Aug 22, 2022
@posel
Copy link
Author

posel commented Aug 23, 2022

Bug is partly duplicate with #2671 but not completely - some of the errors are not new:

  • Problem with changing text to the code block is occasionally even with previous version 3.1.10. Particularly, it has problem when user insert URL link in the wysiwyg mode, then switches to the markdown mode and saves
  • Symbols ~~~ are added at the of the text in the editor in the former versions as well.

@williamsun1993
Copy link

mark.

@jethrolarson
Copy link
Contributor

This is happening to me as well. Seems to not be triggered by adding the link but by attempting to render a link as any existing markdown that is loaded with a link causes the same exception:

[TSfoft Latam](https://google.com)

image

@jethrolarson
Copy link
Contributor

Seems like some kind of bundling error. Like the react-editor isn't handling the dependency on @tui/editor right when building it.

Then again this could be caused by my bundling system as I'm using dynamic import with nextjs to load the editor

@jethrolarson
Copy link
Contributor

Seems to be because build inserted $1 at the end of the variable definition for getCustomAttrs everywhere except in the definition of Link which you can see at line 19255 of node_modules/@toast-ui/editor/dist/esm/index.js at version 3.2.0.

I pulled this project and ran npm run build editor and that generated the file without the $1 suffix so maybe just a rerelease of tui.editor will resolve?

@jethrolarson
Copy link
Contributor

No, wait, I fixed it on accident by removing an unnecessary cast and typescript suppression :D

I'll put up an MR.

@spencerpowell
Copy link

@jethrolarson Thank you! Weirdly enough it is working for me locally, but not on my Vercel deployed Next.js app. Hoping your PR fixes the issue though

@suny-am
Copy link

suny-am commented Sep 21, 2022

Seems to be because build inserted $1 at the end of the variable definition for getCustomAttrs everywhere except in the definition of Link which you can see at line 19255 of node_modules/@toast-ui/editor/dist/esm/index.js at version 3.2.0.

I pulled this project and ran npm run build editor and that generated the file without the $1 suffix so maybe just a rerelease of tui.editor will resolve?

I spotted this as well after having run into the issue via both Hugo's internal ESbuild pipe and Snowpack; glad to see a resolution is in sight!

@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

6 participants