Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unconditional access to global __VUE_PROD_DEVTOOLS__ breaks SSR #1715

Open
5 tasks done
s-ol opened this issue Jul 30, 2024 · 0 comments
Open
5 tasks done

Unconditional access to global __VUE_PROD_DEVTOOLS__ breaks SSR #1715

s-ol opened this issue Jul 30, 2024 · 0 comments
Labels
Status: Review Needed Request for review comments

Comments

@s-ol
Copy link

s-ol commented Jul 30, 2024

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

@s-ol s-ol added the Status: Review Needed Request for review comments label Jul 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Review Needed Request for review comments
Projects
None yet
Development

No branches or pull requests

1 participant