kazupon / vue-i18n

:globe_with_meridians: Internationalization plugin for Vue.js
https://kazupon.github.io/vue-i18n/
MIT License
7.27k stars 860 forks source link

Uncaught (in promise) SyntaxError: Must be called at the top of a `setup` function #1703

Open frederikheld opened 5 months ago

frederikheld commented 5 months ago

Reporting a bug?

The above error message is very useless because it does neither tell me what the problem is nor how this could be fixed.

I had this error several times and I think I remember that this can be fixed with some i18n init stuff but every time I encounter it, I have to waste several hours to figure it out again.

Expected behavior

A clear error message that tells me:

A note about this error and the solution (or possible solutions) in the docs.

Reproduction

//

System Info

System:
    OS: Linux 6.5 Ubuntu 22.04.4 LTS 22.04.4 LTS (Jammy Jellyfish)
    Container: Yes
    Shell: 5.8.1 - /usr/bin/zsh
  Binaries:
    Node: 20.11.0 - ~/.nvm/versions/node/v20.11.0/bin/node
    Yarn: 1.22.21 - /usr/bin/yarn
    npm: 10.2.4 - ~/.nvm/versions/node/v20.11.0/bin/npm

I mainly use Firefox (currently 125.0) and Chromium (currently 123.0) for development and it happens in both.

Screenshot

image

Last line is the position in my own source code where the error comes from. The stack trace is way longer though.

Additional context

No response

Validations

Hakityc commented 2 months ago

同样的问题

Hakityc commented 2 months ago

image