wickedest / Mergely

Merge and diff documents online
http://www.mergely.com
Other
1.17k stars 228 forks source link

When the modified difference point scrolls to the viewport, error: 'k is not defined ' #183

Closed ZiggsTw closed 6 months ago

ZiggsTw commented 8 months ago

It was a great tool for my project, but there was a problem with it. This problem occurs only when the content of one of the left and right files is only modified (not added and not deleted).

Error message :

configuration.3eacb321.js:811 Uncaught ReferenceError: k is not defined
    at j._sms (configuration.3eacb321.js:811:876)
    at j._lcs (configuration.3eacb321.js:811:256)
    at new j (configuration.3eacb321.js:807:23732)
    at C.addInlineDiff (configuration.3eacb321.js:835:6004)
    at M._markupLineChanges (configuration.3eacb321.js:807:18201)
    at M._renderChanges (configuration.3eacb321.js:807:14360)
    at M._scrolling (configuration.3eacb321.js:807:13361)
    at configuration.3eacb321.js:807:8961

Code :

Implement basic functions according to the Upgrade module in the document.

Project information:

ZiggsTw commented 6 months ago
wickedest commented 6 months ago

Unfortunately, you gave me very little to work with - a couple of images and no context. I think this is your project. I think the issue is how you are integrating mergely with vue/vite. Perhaps it is strict mode or some JS/ES6 compatibility that you are using to compile/bundle the project.

ZiggsTw commented 6 months ago

Unfortunately, you gave me very little to work with - a couple of images and no context. I think this is your project. I think the issue is how you are integrating mergely with vue/vite. Perhaps it is strict mode or some JS/ES6 compatibility that you are using to compile/bundle the project.

Sorry, I didn't explain it clearly. The problem occurred in my project, and I attempted to create multiple versions of Vue initialization projects to locate the problem. I found that the problem occurred in projects using Vite (including Vue3 and Vue2.7), and the way to reproduce the problem was to modify certain words in the middle of the same text.I will provide some key code screenshots:

mergelyCode package

https://github.com/wickedest/Mergely/assets/55838681/d08cd4a9-1c40-49ed-bee7-7e227303b2d0

app

github-actions[bot] commented 6 months ago

:tada: This issue has been resolved in version 5.1.1 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

wickedest commented 6 months ago

@ZiggsTw, fixed - thanks for reporting the issue

ZiggsTw commented 6 months ago

Thank you for your reply. We hope it becomes increasingly powerful.

@ZiggsTw, fixed - thanks for reporting the issue