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

fileupload() is not function #101

Open
raoaamirmuhammad opened this issue Sep 17, 2019 · 4 comments
Open

fileupload() is not function #101

raoaamirmuhammad opened this issue Sep 17, 2019 · 4 comments
Labels

Comments

@raoaamirmuhammad
Copy link

raoaamirmuhammad commented Sep 17, 2019

I have the following jquery gems in my Gemfile
gem 'jquery-rails' gem "jquery-ui-rails" gem 'jquery-fileupload-rails'

I added in my application.js
//= require jquery-fileupload/basic

Form is
<%= form_with model: @xyz, html: { multipart: true, id: "fileupload" } do |f| %> <% end %>

and the script is
<script> $(function() { $('#fileupload').fileupload(); }); </script>

I got error
Screenshot from 2019-09-17 10-21-34

I am using activestorage, not carrierwave
Can anyone help me here

@felixbuenemann
Copy link
Collaborator

Have you also required jquery above jquery-fileupload in application.js?

@raoaamirmuhammad
Copy link
Author

Yes I required the following jquery before jquery-fileupload
//= require jquery3
//= require jquery-ui

@raoaamirmuhammad
Copy link
Author

I also required jquery-fileupload but didn't work

@felixbuenemann
Copy link
Collaborator

The error message shows jquery-1.12.4.js, but you said you require jquery3 which is jQuery 4.3.1 in the latest version of jquery-rails, so I think you are loading another copy of jQuery with some other vendored script and that is causing the problem.

Check your assets in chrome devtools, to see were the duplicate jQuery is comming from and get rid of it.

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

No branches or pull requests

2 participants