question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Quasar not work in production (vite-plugin)

See original GitHub issue

What 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:closed
  • Created a year ago
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
CharlieDigitalcommented, Sep 27, 2022

@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 from 1.2.11.2.3
  • quasar from 2.8.32.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.

1reaction
MikesAtMITcommented, Nov 22, 2022

@CharlieDigital I finally figured out what the problem was in my project. It was the order of the options in the vite config file:

// does not work
export default defineConfig({
  plugins: [
    quasar({ sassVariables: '@/assets/quasar-variables.sass' }),
    vue({ template: { transformAssetUrls }}),
  ],
})

// does work
export default defineConfig({
  plugins: [
    vue({ template: { transformAssetUrls }}),
    quasar({ sassVariables: '@/assets/quasar-variables.sass' }),
  ],
})

Both work fine in npm run dev, it’s just when you npm run build that the first config doesn’t properly build the quasar components.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found