kommitters / editorjs-undo

Undo/Redo feature for Editor.js
https://www.npmjs.com/package/editorjs-undo
MIT License
167 stars 52 forks source link

TypeError: can't access property "type", t[i] is undefined in Next.js #175

Closed psalchow closed 1 year ago

psalchow commented 1 year ago

This fixes the following error: "Unhandled promise rejection: Cannot read properties of undefined (reading 'type')" described in #156

Snippet from our minified Code:

... r=t;e[t]||(r-=n-e.length);var o="paragraph"===e[r].type||"header"===e[r].type?this.getCaretIndex(t):null;this.stack.push({index:r,state:e,caretIndex:o}),this.position+=1,this.onUpdate()}}
------------------------------------------------------^
miguelnietoa commented 1 year ago

Thanks for submitting this PR @psalchow 🎉 Please follow this guide in order to sign the commit, and be able to merge this pull request. https://docs.github.com/en/authentication/managing-commit-signature-verification/about-commit-signature-verification

psalchow commented 1 year ago

Now I signed the commit

einerzg commented 1 year ago

Thanks for your contribution! ✌🏻