Vue i18n : Pluralization and Linked Messages not interpreted in production - vue.js

I've managed to integrate nicely the vue-i18n library on my development environment and it works perfectly.
However, when I deploy the project on Heroku, every message using vue-i18n Pluralization or Linked Locale Messages is not being interpreted and shows the entire locale message string :
I've opened a discussion on the repo but no reply so far...
I am using vue-i18n (9.2.2) in a Nuxt3 plugin, therefore using VueJS 3, building with Vite with the plugin for vue-i18n vite-plugin-vue-i18n.
Nuxt3 configuration (nuxt.config.ts), showing the Vite plugin config to resolve the locales JSON files :
import { defineNuxtConfig } from 'nuxt'
import { resolve, dirname } from 'node:path'
import { fileURLToPath } from 'url'
import VueI18nVitePlugin from '#intlify/unplugin-vue-i18n/vite'
export default defineNuxtConfig({
...
vite: {
plugins: [
VueI18nVitePlugin({
include: [
resolve(dirname(fileURLToPath(import.meta.url)), './locales/*.json')
]
})
]
},
...
});
Nuxt plugin for vue-i18n (plugins/vue-i18n.ts) :
import { createI18n } from 'vue-i18n'
import fr from '~/locales/fr.json'
import en from '~/locales/en.json'
// DOC I18N : https://www.i18next.com/translation-function/essentials
export default defineNuxtPlugin(({ vueApp }) => {
const i18n = createI18n({
legacy: false,
allowComposition: true,
globalInjection: true,
locale: 'fr',
fallbackLocale: 'en',
messages: {
'en': en,
'fr': fr,
}
});
vueApp.use(i18n);
})
And here are the 2 locales files :
locales/fr.json :
{
"test": "Zero test | Un test | {n} tests",
"testnested": {
"nestedvalue": "Zero sous-test | Un sous-test | {n} sous-tests"
},
...
locales/en.json :
"test": "Zero test | One test | {n} tests",
"testnested": {
"nestedvalue": "Zero sub-test | Un sub-test | {n} sub-tests"
},
...
}
Example of how the locale messages are used within the Vue templates :
<p>
-- TEST ROOT --<br />
{{ $t('test', 0) }}<br />
{{ $t('test', 1) }}<br />
{{ $t('test', 2) }}<br />
<br />
-- TEST NESTED --<br />
{{ $t('testnested.nestedvalue', 0) }}<br />
{{ $t('testnested.nestedvalue', 1) }}<br />
{{ $t('testnested.nestedvalue', 2) }}<br />
</p>
The Plurals and Linked messages syntax in the locales messages should be interpreted by vue-i18n and not display the full locale message string.
[EXPECTED] Local environment output :
[BUG RESULT] Same code packaged for production, deployed on Heroku :
Another example with failing Linked Messages (in production) :
Here are some infos about my system :
System:
OS: Windows 10 10.0.22000
CPU: (8) x64 Intel(R) Core(TM) i7-1065G7 CPU # 1.30GHz
Memory: 16.35 GB / 31.59 GB
Binaries:
Node: 16.13.2 - C:\Program Files\nodejs\node.EXE
Yarn: 1.22.17 - C:\Program Files\nodejs\yarn.CMD
npm: 8.1.2 - C:\Program Files\nodejs\npm.CMD
Browsers:
Edge: Spartan (44.22000.120.0),
Chromium (105.0.1343.27)
Internet Explorer: 11.0.22000.120
npmPackages:
#intlify/unplugin-vue-i18n: ^0.5.0 => 0.5.0
vitest: ^0.20.3 => 0.20.3
vue-i18n: ^9.2.2 => 9.2.2
vue-toastification: next => 2.0.0-rc.5
I have read on other threads and on StackOverflow here but the accepted answer doesn't seem to be up-to-date, and believe there could be issues with the way webpack or vite are packaging the project.
What am I doing wrong here ?
If nothing seems wrong, would you recommend I open a bug report on vue-i18n repo ? Or on the #intlify/vite-plugin-vue-i18n repository ?

I had the same problem.
Think this is an issue with the vite-plugin-vue-i18n pre-compile which converts messages to JS functions. I set runtimeOnly:false in vite.config.js and it then worked the same in Production as in HMR.

Related

vue-i18n not substituting tokens in production build

We have a Quasar 2 based project that makes use of vue-i18n for localising of strings, but are running into an issue whereby strings with replacement tokens aren't getting handled properly in our dev host and production deployments.
In our language file:
export default {
'label.deleteUserConfirm': 'Saisissez le {personId} pour confirmer la suppression'
}
In our Vue file, in the template section:
<template>
<div>
{{ $t('label.deleteUserConfirm', { personId: '12345' }) }}
</div>
</template>
When running in localhost the displayed text is:
Saisissez le 12345 pour confirmer la suppression
In our deployments
Saisissez le {personId} pour confirmer la suppression
Based on docs for #intlify/vite-plugin-vue-i18n we did try specifying compositionOnly: false in the quasar.conf.js, but that doesn't seem to have made a difference.
We are building our project with Vite. Looking in the dist/spa folder we don't see any evidence of corruption of the strings, as they appear in the js, in the assets folder.
The results of quasar build show this issue, while the dev version run by quasar dev don't. This is an SPA target.
Environment info:
vue-i18n 9.2.2
vite 2.9.15
#intlify/vite-plugin-vue-i18n 6.0.3
quasar 2.10.1
node 16.10.0
Update: I just tried creating a Quasar project from scratch using yarn create quasar and it shows the same issues. Trying this with new vue + vue-i18n project, using vite, only shows the issue once I use #intlify/unplugin-vue-i18n/vite, suggesting the issue is related to that.
If you are using Vue2 use this library Vue-i18n for Vue2
If you are using vue3 use this one Vue-i18n for Vue3.
It will work fine with these packages
These packages supported by nuxt and vue community so it will best solution
Turns out we need to provide the runtimeOnly: false option, to #intlify/vite-plugin-vue-i18n, to deal with this issue.
The documentation does cover this, but it isn't clear until you run into this problem:
Also, if you do a production build with vite, Vue I18n will automatically bundle the runtime only module. If you need on-demand compilation with Message compiler, you need to set the runtimeOnly option to false.
If I understand rightly, then without this option the messages are optimised at compile time and can't benefit from the token substitutions.
So, if you are using Quasar, in the quasar.conf.js
vitePlugins: [
['#intlify/vite-plugin-vue-i18n', {
// if you want to use Vue I18n Legacy API, you
// need to set `compositionOnly: false`
// compositionOnly: false,
runtimeOnly: false,
// you need to set i18n resource including paths !
include: path.resolve(__dirname, './src/i18n/**')
}]
],
If you are using pure Vue3, with Vite, then in the vite.config.ts file:
import { fileURLToPath, URL } from 'node:url'
import { defineConfig } from 'vite'
import vue from '#vitejs/plugin-vue'
import VueI18nPlugin from '#intlify/unplugin-vue-i18n/vite'
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
vue(),
VueI18nPlugin({
runtimeOnly: false
})
],
resolve: {
alias: {
'#': fileURLToPath(new URL('./src', import.meta.url))
}
}
})

Unable to load stencil components lib with Vue3 using Vite

I created a sample project to reproduce this issue: https://github.com/splanard/vue3-vite-web-components
I initialized a vue3 project using npm init vue#latest, as recommanded in the official documentation.
Then I installed Scale, a stencil-built web components library. (I have the exact same issue with the internal design system of my company, so I searched for public stencil-built libraries to reproduce the issue.)
I configured the following in main.ts:
import '#telekom/scale-components-neutral/dist/scale-components/scale-components.css';
import { applyPolyfills, defineCustomElements } from '#telekom/scale-components-neutral/loader';
const app = createApp(App);
app.config.compilerOptions.isCustomElement = (tag) => tag.startsWith('scale-')
applyPolyfills().then(() => {
defineCustomElements(window);
});
And the same isCustomElement function in vite.config.js:
export default defineConfig({
plugins: [vue({
template: {
compilerOptions: {
isCustomElement: (tag) => tag.startsWith('scale-')
}
}
})]
// ...
})
I inserted a simple button in my view (TestView.vue), then run npm run dev.
When opening my test page (/test) containing the web component, I have an error in my web browser's console:
failed to load module "http://localhost:3000/node_modules/.vite/deps/scale-button_14.entry.js?import" because of disallowed MIME type " "
As it's the case with both Scale and my company's design system, I'm pretty sure it's reproducible with any stencil-based components library.
Edit
It appears that node_modules/.vite is the directory where Vite's dependency pre-bundling feature caches things. And the script scale-button_14.entry.js the browser fails to load doesn't exist at all in node_modules/.vite/deps. So the issue might be linked to this "dependency pre-bundling" feature: somehow, could it not detect the components from the library loader?
Edit 2
I just found out there is an issue in Stencil repository mentioning that dynamic imports do not work with modern built tools like Vite. This issue has been closed 7 days ago (lucky me!), and version 2.16.0 of Stencil is supposed to fix this. We shall see.
For the time being, dropping the lazy loading and loading all the components at once through a plain old script tag in the HTML template seems to be an acceptable workaround.
<link rel="stylesheet" href="node_modules/#telekom/scale-components/dist/scale-components/scale-components.css">
<script type="module" src="node_modules/#telekom/scale-components/dist/scale-components/scale-components.esm.js"></script>
However, I can't get vite pre-bundling feature to ignore these imports. I configured optimizeDeps.exclude in vite.config.js but I still get massive warnings from vite when I run npm run dev:
export default defineConfig({
optimizeDeps: {
exclude: [
// I tried pretty much everything here: no way to force vite pre-bundling to ignore it...
'scale-components-neutral'
'#telekom/scale-components-neutral'
'#telekom/scale-components-neutral/**/*'
'#telekom/scale-components-neutral/**/*.js'
'node_modules/#telekom/scale-components-neutral/**/*.js'
],
},
// ...
});
This issue has been fixed by Stencil in version 2.16.
Upgrading Stencil to 2.16.1 in the components library dependency and rebuilding it with the experimentalImportInjection flag solved the problem.
Then, I can import it following the official documentation:
main.ts
import '#telekom/scale-components-neutral/dist/scale-components/scale-components.css';
import { applyPolyfills, defineCustomElements } from '#telekom/scale-components-neutral/loader';
const app = createApp(App);
applyPolyfills().then(() => {
defineCustomElements(window);
});
And configure the custom elements in vite config:
vite.config.js
export default defineConfig({
plugins: [vue({
template: {
compilerOptions: {
isCustomElement: (tag) => tag.startsWith('scale-')
}
}
})]
// ...
})
I did not configure main.ts
stencil.js version is 2.12.1,tsconfig.json add new config option in stencil:
{
"compilerOptions": {
...
"skipLibCheck": true,
...
}
}
add new config option in webpack.config.js :
vue 3 document
...
module: {
rules:[
...
{
test: /\.vue$/,
use: {
loader: "vue-loader",
options: {
compilerOptions: {
isCustomElement: tag => tag.includes("-")
}
}
}
}
...
]
}
...

You are running the esm-bundler build of vue-i18n. It is recommended to configure your bundler to explicitly replace feature flag globals [duplicate]

I have created an ionic app and added vue-i18n.
npx ionic start myapp tabs --type vue
npm install vue-i18n#next
I did the very first step of the VueI18n setup and added this to "./src/main.ts":
import { createI18n } from 'vue-i18n';
const i18n = createI18n({
locale: 'de',
fallbackLocale: 'en',
messages: {en: {testMessage: 'Test message'}, de: {testMessage: 'Testnachricht'}}
});
When looking at the result after npx ionic serve I get the following warning in the browser console:
You are running the esm-bundler build of vue-i18n. It is recommended to configure your bundler to explicitly replace feature flag globals with boolean literals to get proper tree-shaking in the final bundle.
And I get this info in the browser console:
You are running a development build of vue-i18n.
Make sure to use the production build (*.prod.js) when deploying for production.
When I comment out the snippet added to "./src/main.ts" both the notifications disappear. So they really seem to be caused by vue-i18n.
After asking Google I still don't know what to do about these notifications. What are they telling me? Should I do something about them? What can I do specifically?
These are the files that were automatically created in the root folder of the new project:
./ionic.config.json
./cypress.json
./jest.config.js
./babel.config.js
./.gitignore
./package-lock.json
./package.json
./.eslintrc.js
./tsconfig.json
./capacitor.config.json
./.browserslistrc
Please also tell me where I would need to change something. Also
$ find . -type f ! -name package-lock.json -maxdepth 1 -exec grep -iH webpack {} \;
./tsconfig.json: "webpack-env",
so I will not know what to do if you tell me to "just set up webpack properly".
Now i am using this way to import the i18n, the warning is disapear
import { createI18n } from 'vue-i18n/index'
vue-i18n has instructions for every bundler how to set global feature flags so this warning will go away
https://vue-i18n.intlify.dev/guide/advanced/optimization.html#reduce-bundle-size-with-feature-build-flags
I'm using Vite, and I added this to vite.config.ts
import { defineConfig } from 'vite';
export default defineConfig({
define: {
__VUE_I18N_FULL_INSTALL__: true,
__VUE_I18N_LEGACY_API__: false,
__INTLIFY_PROD_DEVTOOLS__: false,
},
// ...
});
This is a known bug apparently. They say it will be fixed in the 9.2 version.
See more info in this thread: https://github.com/intlify/vue-i18n-next/issues/391
I got the same warning in my console with the old package. Then I updated the project to "vue-i18n": "^9.2.0-beta.15" and it was fine.
First install vue-18n to latest package (^9.2.0-beta.15):
npm i --save vue-i18n#next
Then:
I created i18n.ts file on same path with main.ts
import { createI18n, LocaleMessages, LocaleMessageValue, VueMessageType } from 'vue-i18n';
/**
* Load locale messages
*
* The loaded `JSON` locale messages is pre-compiled by `#intlify/vue-i18n-loader`, which is integrated into `vue-cli-plugin-i18n`.
* See: https://github.com/intlify/vue-i18n-loader#rocket-i18n-resource-pre-compilation
*/
function loadLocaleMessages(): LocaleMessages<Record<string, LocaleMessageValue<VueMessageType>>> {
const locales = require.context('./locales', true, /[A-Za-z0-9-_,\s]+\.json$/i);
const messages: LocaleMessages<Record<string, LocaleMessageValue<VueMessageType>>> = {};
locales.keys().forEach((key) => {
const matched = key.match(/([A-Za-z0-9-_]+)\./i);
if (matched && matched.length > 1) {
const locale = matched[1];
messages[locale] = locales(key).default;
}
});
return messages;
}
const setDateTimeFormats = {
short: {
year: 'numeric',
month: 'short',
day: 'numeric',
},
long: {
year: 'numeric',
month: 'long',
day: 'numeric',
weekday: 'long',
hour: 'numeric',
minute: 'numeric',
},
};
const dateTimeFormats = {
en: setDateTimeFormats,
es: setDateTimeFormats,
de: setDateTimeFormats,
'en-GB': setDateTimeFormats,
};
export default createI18n({
locale: process.env.VUE_APP_I18N_LOCALE || 'tr',
fallbackLocale: process.env.VUE_APP_I18N_FALLBACK_LOCALE || 'en',
messages: loadLocaleMessages(),
dateTimeFormats,
});
And my main.ts file:
import i18n from './i18n';
app.use(i18n).use(store).use(router).mount('body');
I'm using Vue-cli, after this solution I resolve the same problem, just try it!
config in vue.config.js:
const { defineConfig } = require('#vue/cli-service')
module.exports = defineConfig({
transpileDependencies: true,
**chainWebpack: config => {
config.resolve.alias.set('vue-i18n', 'vue-i18n/dist/vue-i18n.cjs.js')
}**
})
Solution for Nuxt 3 ("nuxt": "3.0.0-rc.12") with Vite.
Just in case:
(You know that your Nuxt app use Vite, if you see "Vite client warmed up in ...ms" when starting server)
About configuring build tools:
https://v3.nuxtjs.org/migration/bundling/
yourApp/nuxt.config.ts :
export default defineNuxtConfig({
vite: {
define: {
__VUE_I18N_FULL_INSTALL__: true,
__VUE_I18N_LEGACY_API__: false,
__INTLIFY_PROD_DEVTOOLS__: false,
},
}
})
vite.config.ts
alias: {
'vue-i18n': 'vue-i18n/dist/vue-i18n.cjs.js',
},
npm i vue-i18n
import { createI18n } from 'vue-i18n/dist/vue-i18n.cjs'
This works for me in Vue3.
My #vue/cli 5.0.3 version.
My vue-i18n version is 9.2.2.
I had vue-i18n#9.1.6. This version has a bug. Of course we can update to 9.2.2 (the latest at the moment), but this need Vue 3.2+ to have effectScope. To use Vue 3.2 application need current Typescript version as well. So we stick to 9.1.10 and added some code to vue.config.js
module.exports = {
//...
chainWebpack: (config) =>
config.plugin("feature-flags").tap((args) => {
args[0].__VUE_I18N_FULL_INSTALL__ = JSON.stringify(true);
args[0].__VUE_I18N_LEGACY_API__ = JSON.stringify(false);
return args;
}),
};
These manipulations sorted warning in my case.
Update both vue-i18n and #intlify/vite-plugin-vue-i18n to the next version.
npm i vue-i18n#next
npm i --save-dev #intlify/vite-plugin-vue-i18n#next

You are running the esm-bundler build of vue-i18n. It is recommended to configure your bundler to explicitly replace feature flag globals with

I have created an ionic app and added vue-i18n.
npx ionic start myapp tabs --type vue
npm install vue-i18n#next
I did the very first step of the VueI18n setup and added this to "./src/main.ts":
import { createI18n } from 'vue-i18n';
const i18n = createI18n({
locale: 'de',
fallbackLocale: 'en',
messages: {en: {testMessage: 'Test message'}, de: {testMessage: 'Testnachricht'}}
});
When looking at the result after npx ionic serve I get the following warning in the browser console:
You are running the esm-bundler build of vue-i18n. It is recommended to configure your bundler to explicitly replace feature flag globals with boolean literals to get proper tree-shaking in the final bundle.
And I get this info in the browser console:
You are running a development build of vue-i18n.
Make sure to use the production build (*.prod.js) when deploying for production.
When I comment out the snippet added to "./src/main.ts" both the notifications disappear. So they really seem to be caused by vue-i18n.
After asking Google I still don't know what to do about these notifications. What are they telling me? Should I do something about them? What can I do specifically?
These are the files that were automatically created in the root folder of the new project:
./ionic.config.json
./cypress.json
./jest.config.js
./babel.config.js
./.gitignore
./package-lock.json
./package.json
./.eslintrc.js
./tsconfig.json
./capacitor.config.json
./.browserslistrc
Please also tell me where I would need to change something. Also
$ find . -type f ! -name package-lock.json -maxdepth 1 -exec grep -iH webpack {} \;
./tsconfig.json: "webpack-env",
so I will not know what to do if you tell me to "just set up webpack properly".
Now i am using this way to import the i18n, the warning is disapear
import { createI18n } from 'vue-i18n/index'
vue-i18n has instructions for every bundler how to set global feature flags so this warning will go away
https://vue-i18n.intlify.dev/guide/advanced/optimization.html#reduce-bundle-size-with-feature-build-flags
I'm using Vite, and I added this to vite.config.ts
import { defineConfig } from 'vite';
export default defineConfig({
define: {
__VUE_I18N_FULL_INSTALL__: true,
__VUE_I18N_LEGACY_API__: false,
__INTLIFY_PROD_DEVTOOLS__: false,
},
// ...
});
This is a known bug apparently. They say it will be fixed in the 9.2 version.
See more info in this thread: https://github.com/intlify/vue-i18n-next/issues/391
I got the same warning in my console with the old package. Then I updated the project to "vue-i18n": "^9.2.0-beta.15" and it was fine.
First install vue-18n to latest package (^9.2.0-beta.15):
npm i --save vue-i18n#next
Then:
I created i18n.ts file on same path with main.ts
import { createI18n, LocaleMessages, LocaleMessageValue, VueMessageType } from 'vue-i18n';
/**
* Load locale messages
*
* The loaded `JSON` locale messages is pre-compiled by `#intlify/vue-i18n-loader`, which is integrated into `vue-cli-plugin-i18n`.
* See: https://github.com/intlify/vue-i18n-loader#rocket-i18n-resource-pre-compilation
*/
function loadLocaleMessages(): LocaleMessages<Record<string, LocaleMessageValue<VueMessageType>>> {
const locales = require.context('./locales', true, /[A-Za-z0-9-_,\s]+\.json$/i);
const messages: LocaleMessages<Record<string, LocaleMessageValue<VueMessageType>>> = {};
locales.keys().forEach((key) => {
const matched = key.match(/([A-Za-z0-9-_]+)\./i);
if (matched && matched.length > 1) {
const locale = matched[1];
messages[locale] = locales(key).default;
}
});
return messages;
}
const setDateTimeFormats = {
short: {
year: 'numeric',
month: 'short',
day: 'numeric',
},
long: {
year: 'numeric',
month: 'long',
day: 'numeric',
weekday: 'long',
hour: 'numeric',
minute: 'numeric',
},
};
const dateTimeFormats = {
en: setDateTimeFormats,
es: setDateTimeFormats,
de: setDateTimeFormats,
'en-GB': setDateTimeFormats,
};
export default createI18n({
locale: process.env.VUE_APP_I18N_LOCALE || 'tr',
fallbackLocale: process.env.VUE_APP_I18N_FALLBACK_LOCALE || 'en',
messages: loadLocaleMessages(),
dateTimeFormats,
});
And my main.ts file:
import i18n from './i18n';
app.use(i18n).use(store).use(router).mount('body');
I'm using Vue-cli, after this solution I resolve the same problem, just try it!
config in vue.config.js:
const { defineConfig } = require('#vue/cli-service')
module.exports = defineConfig({
transpileDependencies: true,
**chainWebpack: config => {
config.resolve.alias.set('vue-i18n', 'vue-i18n/dist/vue-i18n.cjs.js')
}**
})
Solution for Nuxt 3 ("nuxt": "3.0.0-rc.12") with Vite.
Just in case:
(You know that your Nuxt app use Vite, if you see "Vite client warmed up in ...ms" when starting server)
About configuring build tools:
https://v3.nuxtjs.org/migration/bundling/
yourApp/nuxt.config.ts :
export default defineNuxtConfig({
vite: {
define: {
__VUE_I18N_FULL_INSTALL__: true,
__VUE_I18N_LEGACY_API__: false,
__INTLIFY_PROD_DEVTOOLS__: false,
},
}
})
vite.config.ts
alias: {
'vue-i18n': 'vue-i18n/dist/vue-i18n.cjs.js',
},
npm i vue-i18n
import { createI18n } from 'vue-i18n/dist/vue-i18n.cjs'
This works for me in Vue3.
My #vue/cli 5.0.3 version.
My vue-i18n version is 9.2.2.
I had vue-i18n#9.1.6. This version has a bug. Of course we can update to 9.2.2 (the latest at the moment), but this need Vue 3.2+ to have effectScope. To use Vue 3.2 application need current Typescript version as well. So we stick to 9.1.10 and added some code to vue.config.js
module.exports = {
//...
chainWebpack: (config) =>
config.plugin("feature-flags").tap((args) => {
args[0].__VUE_I18N_FULL_INSTALL__ = JSON.stringify(true);
args[0].__VUE_I18N_LEGACY_API__ = JSON.stringify(false);
return args;
}),
};
These manipulations sorted warning in my case.
Update both vue-i18n and #intlify/vite-plugin-vue-i18n to the next version.
npm i vue-i18n#next
npm i --save-dev #intlify/vite-plugin-vue-i18n#next

Vuepress multiple sidebar don't show all items

I'm learning about vuepress and i'm trouble to config the sidbar.
Description
Following the docs I replicated the multiple-sidebar configuration without success.
Only the first path it is showed. What am i doing worg?
My config js:
module.exports = {
title: "Jhonatan Morais",
description: "Welcome to my documentation site",
editLinks: true,
smoothScroll: true,
themeConfig: {
sidebar: {
"/foo/": ["", "one"],
"/bar/": ["", "three"],
// fallback
"/": ["" /* / */],
},
},
postcss: {
plugins: [require("autoprefixer"), require("tailwindcss")("./tailwind.js")],
},
};
My project organization
My render results from yarn docs:dev
Some others details
If i browse the pages by url they are there
Here is my system info:
Environment Info:
System:
OS: Windows
CPU: (8) x64 Intel(R) Core(TM) i7-4770 CPU # 3.40GHz
Binaries:
Node: 10.16.2 - C:\Users\JHONAT~1.MOR\AppData\Local\Temp\yarn--1593443655966-0.6783257365479927\node.CMD
Yarn: 1.22.4 - C:\Users\JHONAT~1.MOR\AppData\Local\Temp\yarn--1593443655966-0.6783257365479927\yarn.CMD
npm: 6.9.0 - C:\Program Files\nodejs\npm.CMD
npmPackages:
#vuepress/core: 1.5.2
#vuepress/theme-default: 1.5.2
vuepress: ^1.5.2 => 1.5.2
npmGlobalPackages:
vuepress: Not Found
I believe this is working as designed. You will only see the /foo/ sidebar when the route starts with /foo/. So, you won't see the /bar/ sidebar until you go to a route/page that starts with /bar/. You may want to use Sidebar Groups if you want to group links together in a single sidebar that is displayed for every route.