quasarframework / quasar

Quasar Framework - Build high-performance VueJS user interfaces in record time
https://quasar.dev
MIT License
25.77k stars 3.5k forks source link

VueI18N attribute not found in app on production build #14123

Open tanyongkuan opened 2 years ago

tanyongkuan commented 2 years ago

What happened?

I did an explanation over at vue-i18n-next as I thought it could be a vue-i18n error [https://github.com/intlify/vue-i18n-next/issues/1095]

The issue I'm facing is I have i18n on both the local project and app extension. App extension main goal is to combine the local project's i18n objects into the app extensions. I realised that __VUE_I18N__ is not in the app during production build which produces the error on my app extension. Surprisingly, the i18n on the local project still works as normal but I am unable to convert the i18n that is in the app extension.

What did you expect to happen?

No errors should be faced as what I see in development build.

Reproduction URL

NIL as it is an app extension

How to reproduce?

Try to access the app i18n which is configured in the local project using the app extension

Flavour

Quasar CLI with Webpack (@quasar/cli | @quasar/app-webpack)

Areas

App Extension API

Platforms/Browsers

Firefox

Quasar info output

Global packages
  NPM - 8.5.5
  yarn - 1.22.18
  @quasar/cli - 1.3.2
  @quasar/icongenie - Not installed
  cordova - Not installed

Important local packages
  quasar - 2.7.5 -- Build high-performance VueJS user interfaces (SPA, PWA, SSR, Mobile and Desktop) in record time
  @quasar/app-webpack - 3.5.7 -- Quasar Framework App CLI with Webpack
  @quasar/extras - 1.15.0 -- Quasar Framework fonts, icons and animations
  eslint-plugin-quasar - Not installed
  vue - 3.2.37 -- The progressive JavaScript framework for building modern web UI.
  vue-router - 4.1.3
  pinia - 2.0.17 -- Intuitive, type safe and flexible Store for Vue
  vuex - Not installed
  electron - Not installed
  electron-packager - Not installed
  electron-builder - Not installed
  @babel/core - 7.18.9 -- Babel compiler core.
  webpack - 5.74.0 -- Packs CommonJs/AMD modules for the browser. Allows to split your codebase into multiple bundles, which can be loaded on demand. Support loaders to preprocess files, i.e. json, jsx, es7, css, less, ... and your custom stuff.
  webpack-dev-server - 4.9.2 -- Serves a webpack app. Updates the browser on changes.
  workbox-webpack-plugin - Not installed
  register-service-worker - 1.7.2 -- Script for registering service worker, with hooks
  typescript - 4.5.5 -- TypeScript is a language for application scale JavaScript development
  @capacitor/core - Not installed
  @capacitor/cli - Not installed
  @capacitor/android - Not installed
  @capacitor/ios - Not installed

Quasar App Extensions
  --My app extension--

Relevant log output

[Quasar] boot error: TypeError: s.__VUE_I18N__ is undefined

Additional context

No response

github-actions[bot] commented 2 years ago

Hi @tanyongkuan! 👋

It looks like you provided an invalid or unsupported reproduction URL. Do not use any service other than Codepen, jsFiddle, StackBlitz, Codesandbox, and GitHub. Make sure the URL you provided is correct and reachable. You can test it by visiting it in a private tab, another device, etc. Please edit your original post above and provide a valid reproduction URL as explained.

Without a proper reproduction, your issue will have to get closed.

Thank you for your collaboration. 👏