question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

NoModificationAllowedError

See original GitHub issue

No problems in Chrome. When I DnD a file in Firefox, my React app blows up with:

NoModificationAllowedError: Modifications are not allowed for this document

Per https://developer.mozilla.org/en-US/docs/Web/API/DataTransfer/clearData

Note: This method can only be used in the handler for the [dragstart](https://developer.mozilla.org/en-US/docs/Web/API/Document/dragstart_event) event, because that's the only time the drag operation's data store is writeable.

It looks like this code is doing clearData() in the drop handler: https://github.com/KarimMokhtar/react-drag-drop-files/blob/dev/src/useDragging.tsx#L56

This Stack Overflow is related: https://stackoverflow.com/questions/58201273/nomodificationallowederror-in-firefox-when-using-dnd-events

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
KarimMokhtarcommented, Feb 8, 2022

@TroyWolf Thanks for mentioning that.

0reactions
TroyWolfcommented, Feb 10, 2022

Fix has been merged to dev.

Read more comments on GitHub >

github_iconTop Results From Across the Web

NoModificationAllowedError in Firefox when using DnD events
This happens when i try to use the clearData() function on the event when the ondrop event is fired. HTML: <!-- draggable element...
Read more >
Modifications are not allowed for this document Firefox · Issue ...
NoModificationAllowedError : Modifications are not allowed for this document Firefox #86 · Comments · Footer.
Read more >
Element.outerHTML - Web APIs - MDN Web Docs
NoModificationAllowedError DOMException. Thrown if an attempt was made to set outerHTML on an element which is a direct child of a Document ...
Read more >
Element.innerHTML - Web APIs
An attempt was made to set the value of innerHTML using a string which is not properly-formed HTML. NoModificationAllowedError: An attempt was made...
Read more >
NoModificationAllowedError when view Route Diagram
Hi, When I try to view Route Diagram in Management Console, I got "NoModificationAllowedError" and I'm not able to view Route Diagram.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found