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 CLI Vite - build SPA with axios and vue-i18n result in TypeError: le.version.split is not a function

See original GitHub issue

What happened?

When I build SPA with axios and vue-i18n, the sample page is not displayed and the DevTools console shows: TypeError: le.version.split is not a function at axios.fcba7966.js:2:10803s

There is no problem if build with only axios or vue-i18n.

What did you expect to happen?

The sample page is displayed in the browser.

Reproduction URL

no link

How to reproduce?

  1. npm init quasar with following options: √ What would you like to build? » App with Quasar CLI, let’s go! √ Project folder: … qq √ Pick Quasar version: » Quasar v2 (Vue 3 | latest and greatest) √ Pick script type: » Javascript √ Pick Quasar App CLI variant: » Quasar App CLI with Vite (BETA stage) √ Package name: … qq √ Project product name: (must start with letter if building mobile apps) … Quasar App √ Project description: … A Quasar Project √ Author: … qq √ Pick your CSS preprocessor: » Sass with SCSS syntax √ Check the features needed for your project: » Axios, Vue-i18n

  2. cd qq

  3. quasar build

  4. cd dist\spa

  5. caddy file-server --listen :9000

  6. open http://localhost:9000 in the browser

Flavour

Quasar CLI with Vite (@quasar/cli | @quasar/app-vite)

Areas

SPA Mode

Platforms/Browsers

Chrome, Microsoft Edge

Quasar info output

Operating System - Windows_NT(10.0.22000) - win32/x64
NodeJs - 16.14.0

Global packages
  NPM - 8.3.1
  yarn - Not installed
  @quasar/cli - 1.3.1
  @quasar/icongenie - Not installed
  cordova - Not installed

Important local packages
  quasar - 2.6.0 -- Build high-performance VueJS user interfaces (SPA, PWA, SSR, Mobile and Desktop) in record time
  @quasar/app-vite - 1.0.0-beta.3 -- Quasar Framework App CLI with Vite
  @quasar/extras - 1.13.1 -- Quasar Framework fonts, icons and animations
  eslint-plugin-quasar - Not installed
  vue - 3.2.31 -- The progressive JavaScript framework for building modern web UI.
  vue-router - 4.0.14
  pinia - Not installed
  vuex - Not installed
  vite - 2.8.6 -- Native-ESM powered web dev build tool
  eslint - Not installed
  electron - Not installed
  electron-packager - Not installed
  electron-builder - Not installed
  register-service-worker - 1.7.2 -- Script for registering service worker, with hooks
  @capacitor/core - Not installed
  @capacitor/cli - Not installed
  @capacitor/android - Not installed
  @capacitor/ios - Not installed

Quasar App Extensions
  *None installed*

Relevant log output

No response

Additional context

No response

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
selaimanhcommented, Mar 18, 2022

The i18n make a global function $t available for all the components :

file boot i18n.js add globalInjection: true.

export default boot(({ app }) => {
  const i18n = createI18n({
    locale: "en-US",
    globalInjection: true,
    messages,
  });

  // Set i18n instance on app
  app.use(i18n);
});
2reactions
znbangcommented, Mar 17, 2022

Hi, with new scaffolding and the IndexPage.vue:

<template>
  {{ t('success') }}
</template>

<script setup>
import { useI18n } from 'vue-i18n'

const { t } = useI18n()
</script>

the error message is:

TypeError: s is not a function
    at lt (vue-i18n.runtime.esm-bundler.11ca8ca2.js:33:3637)
    at Ve (vue-i18n.runtime.esm-bundler.11ca8ca2.js:33:3009)
    at vue-i18n.runtime.esm-bundler.11ca8ca2.js:37:2706
    at x (vue-i18n.runtime.esm-bundler.11ca8ca2.js:37:2579)
    at Proxy.We (vue-i18n.runtime.esm-bundler.11ca8ca2.js:37:2701)
    at IndexPage.dd6596ca.js:1:1111
    at r (vendor.eb977b9c.js:1:14846)
    at m (render.fe9c2083.js:1:128)
    at Proxy.<anonymous> (IndexPage.dd6596ca.js:1:944)
    at Hn (vendor.eb977b9c.js:1:15150)
Read more comments on GitHub >

github_iconTop Results From Across the Web

Boot files - Quasar Framework
Anatomy of a boot file. A boot file is a simple JavaScript file which can optionally export a function. Quasar will then call...
Read more >
Quasar V16 - Build - n.e is not a function
Hello, I'have problem with latest quasar-cli. I start a new projet with command 'quasar init XXXX'. I use “quasar dev” in my new...
Read more >
TypeError: _l is not a function in Vite deploy in Github Pages?
I build a website using vue and vite, then also fetch from Nintendo-Switch-Eshop API. When I run in dev mode, the API could...
Read more >
Vue i18n: Building a multi-language app with locale switcher
Vue i18n is a key process needed to localize your Vue apps and websites. Learn how to set up a Vue app with...
Read more >
The Ultimate Vue Localization Guide | Phrase
Dive into Vue localization and learn how to plug the Vue I18n library into your app, so you can make it accessible to...
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