[vite] Failed to resolve module import "vue.js".
See original GitHub issueDescribe the bug
I am struggling with this error for a whole day…
I cannot find vue.js module in devtools->Application->Feames->Scripts, but found vue.runtime.esm-bundler.js
Reproduction
Please provide a link to a repo that can reproduce the problem you ran into.
A reproduction is required unless you are absolutely sure that the the problem is obvious and the information you provided is enough for us to understand what the problem is. If a report has only vague description (e.g. just a generic error message) and has no reproduction, it will be closed immediately.
System Info
- required
vite
version: 1.0.0.rc.1 - required Operating System: macOS 10.15
- required Node version: 10.12
- Optional:
- npm/yarn version
- Installed
vue
version (fromyarn.lock
orpackage-lock.json
) - Installed
@vue/compiler-sfc
version
Logs (Optional if provided reproduction)
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Ask Question - Stack Overflow
The error is caused by vite,need to add a suffix, that is .vue in vite. Alter mobile-routes.js inside src/router/module
Read more >failed to resolve module specifier "axios". relative references ...
Fresh install of v26 leads to this error with an import axios from 'axios' was finally able to solve by reverting to a...
Read more >Beginner having issues with Vite build : r/vuejs - Reddit
I'm new to Vue, and after playing around in-browser I wanted to start ... page fails to load with Failed to resolve module...
Read more >Nuxt 3 APP Failed to resolve module specifier "Vue" - Support
Hi, i`m trying to deploy a nuxt 3 app and I'm getting a blank page, along with the message: Uncaught TypeError: Failed to...
Read more >Vite issue using Inertia/React - Laracasts
TypeError : Failed to resolve module specifier ... import { defineConfig } from 'vite'; import laravel from 'laravel-vite-plugin'; import react from ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I got it to work… Please do the following…
npm update
vite.config.js - remove everything
One last thing, ant design will not work… using imports as it requires webpack… Same for many other UI frameworks.
Web components work nicely though…
If you don’t know what
optimizeDeps
is doing, it’s best not to disable it… it’s required for some non-esm dependencies to work. But in the case of Vue resolving this is a bug.