uppy: Invalid target option given to Dashboard

I’m trying to make a really simple setup and keep getting Uncaught Error: Invalid target option given to Dashboard. I’m not sure why as all the options seem to be valid. It doesn’t create the dashboard so I can’t actually open the menu.


const Uppy = require("@uppy/core");
const Dashboard = require("@uppy/dashboard");
const Uploader = require("@uppy/xhr-upload");

const uppy = Uppy({
    debug: true,
    autoProceed: false,
    restrictions: {
        maxFileSize: 1000000,
        maxNumberOfFiles: 1,
        minNumberOfFiles: 1
    }
})
.use(Dashboard, {
    trigger: '#fileUpload'
})
.use(Uploader, {
    endpoint: "/File/Upload",
    method: "POST",
    formData: true
});

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 15 (5 by maintainers)

Commits related to this issue

Most upvoted comments

@kvz @arturi it works fine. Thanks

Forgot the closing </div>, it should be: <div id="pick-files"></div>

I was doing it with ASP.NET MVC, where things are split into several partial html files, so there were some issues addressing the body specifically. I created a div with an id for the target and targeted that and that worked.