Unconditional access to global __VUE_PROD_DEVTOOLS__ breaks SSR
Opened this issue · 0 comments
s-ol commented
Reporting a bug?
vue-i18n attempts to read a global __VUE_PROD_DEVTOOLS__
variable. This causes a ReferenceError
in some engines, especially in an SSR context with recent node versions:
ReferenceError: __VUE_PROD_DEVTOOLS__ is not defined
at Object.install (file:///home/s-ol/dot/vike-repro/node_modules/vue-i18n/dist/vue-i18n.mjs:2284:65)
See also vikejs/vike#1778 (reply in thread).
Expected behavior
globalThis
shoud be checked using '__VUE_PROD_DEVTOOLS__' in globalThis
before attempting to read the variable.
Reproduction
The i18n
branch in this repository illustrates the issue using vike-vue
: https://github.com/s-ol/_vike-vue-i18n-repro/tree/i18n
System Info
System:
OS: Linux 6.9 Arch Linux
CPU: (14) x64 Intel(R) Core(TM) Ultra 7 165U
Memory: 21.91 GB / 30.79 GB
Container: Yes
Shell: 3.7.1 - /usr/bin/fish
Binaries:
Node: 22.4.1 - /usr/bin/node
Yarn: 1.22.22 - /usr/bin/yarn
npm: 10.8.2 - /usr/bin/npm
Browsers:
Chromium: 126.0.6478.182
npmPackages:
@vitejs/plugin-vue: ^5.0.4 => 5.0.4
vite: ^5.1.4 => 5.2.10
vite-plugin-checker: ^0.6.4 => 0.6.4
vue: ^3.4.19 => 3.4.21
vue-i18n: ^9.13.1 => 9.13.1
vue-tsc: ^1.8.27 => 1.8.27
Screenshot
No response
Additional context
No response
Validations
- Read the Contributing Guidelines
- Read the Documentation
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion
- The provided reproduction is a minimal reproducible example of the bug.