uppy: `@uppy/vue` requires installing dashboard even if it's not used

Initial checklist

  • I understand this is a bug report and questions should be posted in the Community Forum
  • I searched issues and couldn’t find anything (or linked relevant results below)

Link to runnable example

No response

Steps to reproduce

  • npm i @uppy/core @uppy/vue @uppy/drag-drop @uppy/status-bar
  • Only use DragDrop and/or StatusBar: import {DragDrop, StatusBar} from '@uppy/vue'
  • Build

Expected behavior

Successful build.

@uppy/dashboard, @uppy/drag-drop, @uppy/file-input, @uppy/progress-bar, and @uppy/status-bar are now peer dependencies. This means you don’t install all these packages if you only need one. To migrate: install only the packages you need. If you use the Dashboard component, you need @uppy/dashboard, and so onwards.

From https://uppy.io/docs/migration-guides.html#uppy-vue

Actual behavior

Build failure:

image

About this issue

  • Original URL
  • State: open
  • Created 2 years ago
  • Reactions: 6
  • Comments: 16 (11 by maintainers)

Most upvoted comments

same problem with @uppy/react

The workaround is to import the individual modules:

import DragDrop from '@uppy/vue/lib/drag-drop.js'
import StatusBar from '@uppy/vue/lib/status-bar.js'

We should probably update the docs to only show imports that targets the individual components modules. We also still have the possibility to put back the uppy plugins as direct dependencies instead of peers in a semver-minor, so if someone feels like it would be a better option, please speak up.

@paulm17 Things changed in v3 as I mentioned above. What I’ll say is, you can upgrade to v3 and the only additional thing you have to do is list @uppy/dashboard and perhaps one other package in your package.json. Those packages were already getting installed in v2. To confirm, you can run the following command for both v2 and v3:

npm ls @uppy/dashboard

And you’ll notice that it’s there in both cases.

I would vote to revert back to how 2.x handles this issue.

Yep, that is what the maintainers will figure out for this ticket.

@paulm17 It’s still installing them automatically for you, since they’re direct dependencies of @uppy/react@2.x.x rather than peer-deps in 3.x.x.