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

flushSync issue when adding an Image from Slash Command #69

Closed
upview opened this issue Jul 4, 2023 · 2 comments
Closed

flushSync issue when adding an Image from Slash Command #69

upview opened this issue Jul 4, 2023 · 2 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@upview
Copy link

upview commented Jul 4, 2023

Hi there, and thank you for your excellent implementation. Trying to replicate it locally I got everything working, except the "Image" option from the slash command menu. I keep getting

Warning: flushSync was called from inside a lifecycle method. React cannot flush when React is already rendering. Consider moving this call to a scheduler task or micro task.

that seems to be caused by the view.dispatch(transaction). Usually its triggered when I insert 2 images in a row, the 1st image is fine. It's working fine from onDrop or onPaste events, but not with the event when slash option is selected.

I am unsure what I could do to solve this issue, do you have any clue? Thanks a lot :)

@steven-tey
Copy link
Owner

Oh good question, haven't dealt with multiple images before – PRs welcome! 👀

@steven-tey steven-tey added bug Something isn't working help wanted Extra attention is needed labels Jul 4, 2023
@upview
Copy link
Author

upview commented Jul 5, 2023

Understood the issue and found a fix here ueberdosis/tiptap#4000. Not an issue of Novel, multiple image upload works well.

@upview upview closed this as completed Jul 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants