Comments (10)
Vue files need to be imported with the .vue
extension. Without the extension, it won't work. E.G
// before
import MyButton from '@/components/util/my-button';
// after
import MyButton from '@/components/util/my-button.vue';
from vite.
Worked for me as well.
Here's a shortcut that worked for me if you have many lines without .vue
Step 1: Add .vue at the end of lines that contains @/components using search in regex mode.
Type in Regex Search
^.*(@/components).*$
Replace with
$0.vue
Execute Replace All
Step 2: Search and Replace ";.vue to .vue";
from vite.
I think it would be cool, if it would work out of the box - without having to add .vue extension to every import
This is not an issue with this plugin but is by design how Vite works.
See vitejs/vite#178 (comment) and https://twitter.com/youyuxi/status/1288859415878283264
from vite.
Not sure if this issue should be closed. I think it would be cool, if it would work out of the box - without having to add
.vue
extension to every import.
You've got a point. I'll reopen this and wait for the maintainers decision.
from vite.
Same here:
html:/Users/user/Projects/big-vue/pages/news/_id.vue:6:28: error: No loader is configured for ".vue" files: components/v3/v3-promo.vue
6 │ v3Promo: () => import('@/components/v3/v3-promo'),
╵ ~~~~~~~~~~~~~~~~~~~~~~~~~~
from vite.
I am having the same issue with layouts...
from vite.
@pierredup it worked
from vite.
Not sure if this issue should be closed. I think it would be cool, if it would work out of the box - without having to add .vue
extension to every import.
from vite.
This is not an issue with this plugin but is by design how Vite works.
Good to know, thanks!
from vite.
I will close this now as it has nothing to do with the plugin.
from vite.
Related Issues (20)
- Undefined `importedModules` on nuxt-vite warmup! HOT 4
- Connot Find Module HOT 11
- Load images from a folder dynamically (?) HOT 3
- __createCJSModule__(...) is not a function HOT 4
- Nuxt with vite gives this error. This version of postcss-preset-env is not optimised to work with PostCSS 8. HOT 10
- vite ssr css problem
- [ERROR] [plugin vite:dep-pre-bundle] Detected inconsistent metadata for the path "node_modules/react/index.js" when it was imported here: HOT 4
- Failed to parse source for import stackblitz fresh install
- Internal server error: Preprocessor dependency "sass" not found. Did you install it? HOT 2
- vite server on a nuxt application takes way to long to start HOT 5
- In some cases, start nuxt build when starting nuxt dev
- Can't use v-runtime-template along with the Nuxt Vite
- Bug: 'dev' command hangs during build HOT 1
- Optional chaining not working HOT 1
- ReferenceError: Cannot access 'module' before initialization
- Duplicative style in browser after build and run 'yarn start' HOT 2
- nuxt-vite not working with nuxt 3.0.0-rc.11 HOT 1
- cannot stop full-reload in hrm HOT 1
- Linking to dynamic route with the nuxtlink HOT 2
- Invalid Link in Readme HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vite.