Closed posel closed 2 years ago
Bug is partly duplicate with #2671 but not completely - some of the errors are not new:
mark.
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)
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
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?
No, wait, I fixed it on accident by removing an unnecessary cast and typescript suppression :D
I'll put up an MR.
@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
Seems to be because build inserted
$1
at the end of the variable definition for getCustomAttrs everywhere except in the definition ofLink
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!
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:
`txt ....
block)Expected behaviour
As before update - simply insert the link
Screenshots
If applicable, add screenshots to help explain your problem.
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:
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:
With the markdown:
What's worse, the same problem occurs when I am trying to insert the link directly in the markdowns without using the dialog:
it puts several ~to the code and when debugged it always fails with the error:
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