Skip to content
This repository has been archived by the owner on Nov 19, 2018. It is now read-only.

Warning: Exception thrown by hook while handling onSetChildren: Invariant Violation: Item must have been set Invariant Violation: Item must have been set #129

Closed
eos87 opened this issue May 29, 2017 · 7 comments

Comments

@eos87
Copy link

eos87 commented May 29, 2017

Hey there, I was playing with these components and when I upload multiple files using dropzone and global progress bar it throws this warning:
Warning: Exception thrown by hook while handling onSetChildren: Invariant Violation: Item must have been set Invariant Violation: Item must have been set

React version: 15.5.4. Also tested with 15.4.2 and same warning.

Here is my example code:

import Dropzone from "react-fine-uploader/dropzone"
import ProgressBar from "react-fine-uploader/progress-bar"
import FineUploaderTraditional from "fine-uploader-wrappers"

let defaultUploaderProps = {
   chunking: {
        enabled: true
    },
    deleteFile: {
        enabled: false,
    },
    retry: {
        enableAuto: true
    },
    validation: {
        sizeLimit: 30000,
        itemLimit: 50
    }    
}

class MyDropzone extends React.Component {
    constructor(props) {
        super(props);

        let _uploaderProps = Object.assign({}, defaultUploaderProps, props.uploaderProps);
        this.uploader = props.uploader || this.getUploader(_uploaderProps);
    }

    static get defaultProps() {
        return {
            dropActiveClassName: "well-dropzone-active",
            multiple: true,
            uploaderProps: {}
        }
    }

    getUploader(uploaderProps) {
        return new FineUploaderTraditional({
            options: uploaderProps
        });
    }

    render() {
        let zoneProps = Object.assign({}, this.props);
        delete zoneProps['uploaderProps'];

        return (
            <div>
                <ProgressBar uploader={this.uploader} className="progress-bar-uploader" />


                <Dropzone className="well well-form-dotted"
                    uploader={this.uploader} {...zoneProps}>

                    <div className="fa-3x">
                        <i className="fa fa-cloud-upload"></i>
                    </div>
                    <strong className="fsize14">
                            Choose your files or drag them here
                    </strong>
                </Dropzone>
            </div>
        )
    }
}

export { MyDropzone }

And here are couple of screenshots just in case they are helpful
http://prntscr.com/fdlss2
http://prntscr.com/fdlt76

These are really nice components! Thanks for this :)

@rnicholus
Copy link
Member

React isn't very good a providing consistently readable error messages. This is one of those. Research indicates this is a bug in React 15 that may be patched in 16.

@rnicholus
Copy link
Member

Haven't heard anything further on this in a while. Perhaps a react issue since fixed? If anyone is still seeing this with a current react version and can identify where react fine uploader is at fault, I can reopen

@jfconde
Copy link

jfconde commented Sep 27, 2017

In the company I work for, we're using React 15.6.1 altogether with ExtJS (ExtReact). This bug is popping up all the time :/

@jfconde
Copy link

jfconde commented Sep 27, 2017

Also, due to the fact that we're using (and bound to use) ExtReact for our current project, we can't upgrade to 16.X either.

@rnicholus
Copy link
Member

rnicholus commented Sep 27, 2017

i haven't seen this issue myself. if you are still seeing it and figure out how to best address it, please post here

@jfconde
Copy link

jfconde commented Sep 28, 2017

I'll do if I can. We need to get this error out of the way in order to continue advancing, so I hope today or tomorrow we can come up with a fix or some explanation about the error, at least.

@askarhu
Copy link

askarhu commented May 30, 2018

Anyone had any luck with this? I got this error after making one simple change to the already working app and even if I backtrack the change it still shows that error.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants