ngx-quill-upload
ngx-quill-upload copied to clipboard
Cannot read properties of null (reading 'removeAttribute') at ImageHandler.loadFile
When I try and upload an image, I am getting this error:
Cannot read properties of null (reading 'removeAttribute') at ImageHandler.loadFile
.
I've had a look into the source code and set breakpoints. The problem seems to be this line:
this.loading.removeAttribute('class');
.
I can see that loadingHTML()
is called on instantiation when debugging.
The div with the id of __ID_SPLIT__.QUILL-LOADING
is present in the DOM at the point of attempting to upload an image.
I can't figure out why the reference to loading
is being set to null.
I have a component that allows users to create and edit documents. This issue only happens when I edit a document that already exists. There's no difference, as far as I know, other than the editor is programatically filled in when a user goes to edit a document. This is obviously causing an issue, but I can not for the life of me figure out why.
@tomdeakin-tootoot Did you figure out why this error is coming, I'm also having same issue.
For me, it seems like registering a module and getting a reference to the loading node happens before most of the structure directives like *ngIf. For instance, you have your entity to be retrieved from the server, and before you get it, you already registered ImageHandler, therefore you called his constructor which receives a reference to the loading node. It happens only once