You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
The requested module '/node_modules/.vite/vue.js?v=d608385f' does not provide an export named 'default' #117
The following is the robot translation, which may not be accurate. Sorry:
Hello! I use vite to build components that use vue.draggable.next. If I introduce it into the project, an error will be reported:The requested module '/node_modules/.vite/vue.js?v=d608385f' does not provide an export named 'default'.This is my project:https://github.com/yaolunmao/vuedraggable-publish-test
You can reproduce the error this way:
git clone https://github.com/yaolunmao/vuedraggable-publish-test
pnpm i
pnpm run build
//Then copy `dist`folder to `assets/`
pnpm run dev
At this time, the browser will report an error:The requested module '/node_modules/.vite/vue.js?v=d608385f' does not provide an export named 'default'
Then modify Line 8 of App.vue, remove the comments, and then comment the code in line 4 and delete the assets / dist folder. You will find that the project is running normally
Then
npm run build
distfolder will be generated, and the folder will be cut under assetsfolder
Modify Line 8 of App.vueagain, comment this line, and uncomment the code in line 4, and you will find that the project reports an error:The requested module '/node_modules/.vite/vue.js?v=d608385f' does not provide an export named 'default'
import draggable from 'vuedraggable/src/vuedraggable'
project is normal
I've implemented this fix, which does work. As others have said, a proper fix would be preferred though, since this seems like a bandaid and not a proper solution.
In our component library repo: we have a <Draggable/> component that has "vuedraggable": "^4.1.0" as a dependency. Works in Storybook just fine. We bundle this component using "vite": "^3.0.3" and publish to our internal GitHub package registry.
When we install our <Draggable/> component in other repos, we get the exact error described in this issue title; that's in Chrome runtime. We're using "vue": "^3.2.37" in all repos.
import draggable from 'vuedraggable/src/vuedraggable'
project is normal
I've implemented this fix, which does work. As others have said, a proper fix would be preferred though, since this seems like a bandaid and not a proper solution.
In our component library repo: we have a <Draggable/> component that has "vuedraggable": "^4.1.0" as a dependency. Works in Storybook just fine. We bundle this component using "vite": "^3.0.3" and publish to our internal GitHub package registry.
When we install our <Draggable/> component in other repos, we get the exact error described in this issue title; that's in Chrome runtime. We're using "vue": "^3.2.37" in all repos.
Hitting the same issue when using in as a Storybook component.
Using this library on a design library I'm working on, it's working just fine on the design library app, but when it's used by other vue apps (using yarn link), the design library app breaks with the same error message as TS's facing.
Activity
yaolunmao commentedon Jan 24, 2022
I found that if
project is normal
dakt commentedon Mar 11, 2022
Same here:
Uncaught SyntaxError: The requested module '/node_modules/.vite/vue.js?v=150b56b8' does not provide an export named 'default'dakt commentedon Mar 11, 2022
This does work but it's ugly and it's prone to breaking due to possible changes
cscan commentedon Jul 5, 2022
Any formal solution for this?
saxoncameron commentedon Oct 4, 2022
Also ran into this issue, found this thread.
I've implemented this fix, which does work. As others have said, a proper fix would be preferred though, since this seems like a bandaid and not a proper solution.
In our component library repo: we have a
<Draggable/>component that has"vuedraggable": "^4.1.0"as adependency. Works in Storybook just fine. We bundle this component using"vite": "^3.0.3"and publish to our internal GitHub package registry.When we install our
<Draggable/>component in other repos, we get the exact error described in this issue title; that's in Chrome runtime. We're using"vue": "^3.2.37"in all repos.Flynamic commentedon Jan 23, 2023
Any updates on this? @David-Desmaisons
cmcleese commentedon Apr 20, 2023
Hitting the same issue when using in as a Storybook component.
rifqi96 commentedon May 24, 2023
Hello is there any update on this?
I'm facing the same issue.
Using this library on a design library I'm working on, it's working just fine on the design library app, but when it's used by other vue apps (using
yarn link), the design library app breaks with the same error message as TS's facing.jingyuLin1999 commentedon Jun 8, 2023
I get the same issue. This code of below may temporarily solve the problem, looking forward to updates.
shishirraven commentedon Jun 19, 2023
import draggable from 'vuedraggable/src/vuedraggable'
Works for now, if anybody founds a better solution please post.
Many Thanks for posting this solution @yaolunmao
nestle49 commentedon Oct 17, 2023
I have the same problem when use draggable package inside ui-kit
Workaround
import draggable from 'vuedraggable/src/vuedraggable'auirarrazaval commentedon Oct 10, 2024
I'm having the exact same issue as @rifqi96 . Any updates on this? Considering this issue is over two years old
nicolidin commentedon Feb 12, 2025
Got the exact issue, friendly ping @David-Desmaisons do you have any idea of how to fix that issue ?
It took me 6 hours to understand why it didn't work when draggable was inside a lib.
(it works in storybook , or directly inside my host project).
Hope people find this issue more easily than myself.