I need some help troubleshooting and issue I am having with Inertia and Vite.
I set up a new project with Inertia and Vite following the instructions in this guide. Everything was going smoothly until I tried importing a node module, Vue Markdown, into one of my Vue components.
When I add the import and add the VueMarkdown component to my component list, Vite throws an error:
Vite Error, /node_modules/.vite/deps/vue-markdown.js?v=50c8d340 optimized info should be defined
I tried looking for some answers online, but didn't find a ton of helpful info. One thing I tried was to add:
optimizeDeps: {
exclude: ["vue-markdown"],
},
to my vite.config.ts.
After adding that change, I no longer get the error from Vite, but instead get an error in the browser console:
Uncaught (in promise) SyntaxError: The requested module '/node_modules/vue-markdown/dist/vue-markdown.common.js?v=952cd7a5' does not provide an export named 'default'
I looked in the file that the error is referencing, and there is indeed a exports.default, so I'm not sure what's going on.
I'm about ready to start over using Webpack instead of Vite, but I thought I'd see if anyone here can help me first.