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

Uncaught Error: Invalid previewsContainer option provided. Please provide a CSS selector or a plain HTML element. #976

Closed
afriapps opened this issue Jun 19, 2015 · 2 comments

Comments

@afriapps
Copy link

Im using the latest code and getting this error while trying to use the previewsContainer:

var myDropzone = new Dropzone(document.body, {
previewsContainer: ".dropzone-previews",
url: "/post/",
});

@vijayviji
Copy link

Is there any update on this issue? I'm too facing this.

I face this when the ".dropzone-previews' doesn't exist (Which will get added later) at the time I'm creating Dropzone.

It's because we're using 'this.previewsContainer = Dropzone.getElement(this.options.previewsContainer, "previewsContainer");' in Dropzone initialization in https://github.com/enyo/dropzone/blob/e524e03c83206f652f9a452f8d1b5b25362fc14a/dist/dropzone-amd-module.js#L466

I've searched for the usage of previewsContainer in the code, and it seems we don't need to do this at this time, and it can be added later when addedFile event is called.

I'm facing this issue with 'clickable' option also.

@enyo
Copy link
Collaborator

enyo commented Oct 20, 2015

The element needs to exist when creating the Dropzone. Just postpone your Dropzone creation until you created the template.

@enyo enyo closed this as completed Oct 20, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants