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

[BUG] onChange does not fire with next.js >= 14.2 #419

Closed
2 tasks done
MISTCLICK opened this issue Apr 14, 2024 · 7 comments
Closed
2 tasks done

[BUG] onChange does not fire with next.js >= 14.2 #419

MISTCLICK opened this issue Apr 14, 2024 · 7 comments
Labels
bug Something isn't working released

Comments

@MISTCLICK
Copy link

MISTCLICK commented Apr 14, 2024

  • I have searched for similar issues in both open and closed tickets and cannot find a duplicate.
  • I have read the documentation and cannot find an answer.

Describe the bug
After updating next.js to version 14.2 and later trying 14.2.1 the onChange function does not fire when the editor input changes. With next.js 14.1.4 the onChange function fires just fine.

Reproduction
I am unfortunately unable to use codesandbox since any attempt to use it results in a complete system crash on my PC.

To Reproduce

  1. Create an empty next.js app using create-next-app with next.js ^14.2
  2. Follow the steps outlined in the docs to create a text editor (using headings, links, quotes and markdownShortcuts plugins).
  3. Create an onChange function (e.g. console.log)
  4. Make changes to the editor and observe no logs in the console

Expected behavior
It is expected for the onChange function to fire every time that a change is made to the text editor.

Screenshots
N/A

Desktop (please complete the following information):

  • OS: Windows 11, Ubuntu 20 (server environments)
  • Browser: Google Chrome (Win 11), Microsoft Edge (Win 11), Opera GX (Win 11), Safari (on mobile, iOS 17.4, iPhone 13).

Additional context
N/A

@MISTCLICK MISTCLICK added the bug Something isn't working label Apr 14, 2024
@jonow
Copy link

jonow commented Apr 15, 2024

I am having the same issue. It was working for me a few days ago, so I think it must be related to the recent update.

@petyosi
Copy link
Contributor

petyosi commented Apr 15, 2024

Confirming that. Next.js 14.2.0 did something that altered Lexical's behavior. I contacted the Lexical team, with a reproduction here: https://github.com/mdx-editor/lexical-issue

Additional details - this is a problem only in dev mode.

@petyosi
Copy link
Contributor

petyosi commented Apr 15, 2024

Opened an issue here: vercel/next.js#64486

Copy link

🎉 This issue has been resolved in version 2.20.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

@petyosi
Copy link
Contributor

petyosi commented Apr 15, 2024

Updated the MDXEditor package to work around the change, now it works in mdx-editor/mdx-editor-in-next@f5d2c7f.

@MISTCLICK
Copy link
Author

Thank you for the prompt reaction and resolution of this issue! <3

@imesse
Copy link

imesse commented Jun 25, 2024

I'm still facing the issue in Next 14.2.4, with mdx editor v: "3.6.1".
Screenshot 2024-06-25 at 16 32 03

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working released
Projects
None yet
Development

No branches or pull requests

4 participants