uppy: "export 'h' (imported as 'Vue') was not found in 'vue'" on several files
I implemented uppy as described on the uppy/vue documentation page but without the webcam plugin like this:
<template>
<div>
<dashboard :uppy="uppy" />
</div>
</template>
<script>
import { Dashboard } from '@uppy/vue'
import '@uppy/core/dist/style.css'
import '@uppy/dashboard/dist/style.css'
import Uppy from '@uppy/core'
export default {
components: {
Dashboard
},
computed: {
uppy: () => new Uppy()
},
beforeDestroy () {
this.uppy.close()
}
}
</script>
I use storybook on the project to work on components isolated and everything seems to work fine on the frontend. But the webpack build gives me warnings that vue was not found on several files.
WARNING in ./node_modules/@uppy/vue/lib/dashboard.js 81:11-16
"export 'h' (imported as 'Vue') was not found in 'vue'
WARNING in ./node_modules/@uppy/vue/lib/dashboard-modal.js 96:11-16
"export 'h' (imported as 'Vue') was not found in 'vue'
WARNING in ./node_modules/@uppy/vue/lib/drag-drop.js 76:11-16
"export 'h' (imported as 'Vue') was not found in 'vue'
WARNING in ./node_modules/@uppy/vue/lib/progress-bar.js 73:11-16
"export 'h' (imported as 'Vue') was not found in 'vue'
WARNING in ./node_modules/@uppy/vue/lib/status-bar.js 76:11-16
"export 'h' (imported as 'Vue') was not found in 'vue'
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 5
- Comments: 17 (10 by maintainers)
@shidcordero @kyrylo93, you guys found a workaround on this?
any update on this? I am getting this warning in my nuxt app
Okay I created a new utility and put that to use in all of the Vue components. The code looks something like this:
And usage in the components looks like this:
This makes the rendering code simpler to read and edit. I think this is a decent solution to the problem; I can open a pull request, if this solution is okay with y’all and @arturi
Okay so following the solution I previously put forward did not end well. However, the error is mitigated by doing something like:
The
String.fromCharCode(104)part generates the string"h", and Webpack doesn’t check if it’s undefined.That was my first attempt at this, but then I realized that something as simple as this would work:
This is much easier to read, and definitely better than my first attempt. For some reason I figured Webpack would be able to figure out that
hwas a pure function with no args and still do export checks.That solution works, but I think the better way to handle this would be to extract all of the logic for getting the correct
hfunction into a utility and then use that in all of the Vue components. That way, future changes are easier to make