Quasar not work in production (vite-plugin)
See original GitHub issueWhat happened?
I followed the official guide to install quasar 2.5.5 to my existing vue3 (vite 3.0.0) project.
pnpm dev
=> works perfect
pnpm build
=> Build successfully but quasar didn’t active on the generated application. For example, a <q-btn>
tag didn’t translate to what it should be in production.
What did you expect to happen?
quasar should active on production.
Reproduction URL
https://github.com/red010182/vue3-starter/tree/quasar
How to reproduce?
dowload quasar branch mentioned above
pnpm i
pnpm build
serve dist folder and check it out
Flavour
Vite Plugin (@quasar/vite-plugin)
Areas
Quasar CLI Commands/Configuration (@quasar/cli | @quasar/app-webpack | @quasar/app-vite), SPA Mode
Platforms/Browsers
OSX/Chrome
Issue Analytics
- State:
- Created a year ago
- Comments:8 (1 by maintainers)
Top Results From Across the Web
Vite plugin for Quasar
Are you sure that you've landed correctly? This page will teach you to use our Vite plugin, but it's not the same as...
Read more >Quasar and Vite - Frontend Application Development at Light ...
So, it is not production ready, if it is still in beta or RC status!!! While running the command above, the creation process...
Read more >Quasar Framework on Twitter: "Here we go. Use Vite with ...
Here we go. Use Vite with Quasar v2 and Vue 3 with our quasar/vite-plugin. Just released it (v1.0.0). Enjoy! ... Here we go....
Read more >Vite: Building a SASS file as it is written - Stack Overflow
import copy from 'rollup-plugin-copy' plugins: [ copy({ targets: [ { src: 'src/style/_quasar-variables.sass', dest: 'dist/style' } ] }) ].
Read more >Env Variables and Modes - Vite
PROD : {boolean} whether the app is running in production. import.meta.env. ... For example, dynamic key access like import.meta.env[key] will not work.
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
@rstoenescu I went to reproduce it with a simple standalone repo and noticed that I could not. When I ran
http-server
from the/dist
folder, everything worked as expected.I double checked the version dependencies.
Went back to my main project and noticed that updating the following resolved the issue:
@quasar/vite-plugin
from1.2.1
→1.2.3
quasar
from2.8.3
→2.8.4
In the sample reproduction project, even downgrading to the versions (deleting
/dist
and/node_modules
) can’t reproduce it.I appreciate the attention and apologize for the false alarm!
For future travelers, update the dep versions.
@CharlieDigital I finally figured out what the problem was in my project. It was the order of the options in the vite config file:
Both work fine in
npm run dev
, it’s just when younpm run build
that the first config doesn’t properly build the quasar components.