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

_ctx.$localePath is not a function #2168

Closed
simkuns opened this issue Jun 16, 2023 · 2 comments · Fixed by #3098
Closed

_ctx.$localePath is not a function #2168

simkuns opened this issue Jun 16, 2023 · 2 comments · Fixed by #3098
Assignees
Labels
API good first issue 🔨 p3-minor-bug Priority 3: a bug in an edge case that only affects very specific usage PR Welcome v8 v9

Comments

@simkuns
Copy link

simkuns commented Jun 16, 2023

Environment


  • Operating System: Linux
  • Node Version: v16.14.2
  • Nuxt Version: 3.5.3
  • Nitro Version: 2.4.1
  • Package Manager: npm@9.4.2
  • Builder: vite
  • User Config: modules
  • Runtime Modules: @nuxtjs/i18n@8.0.0-beta.12
  • Build Modules: -

Reproduction

https://stackblitz.com/edit/github-6vqdsb?file=app.vue,package.json,nuxt.config.ts

Describe the bug

According to documentation available at https://v8.i18n.nuxtjs.org/guide/migrating#change-some-export-apis-name-on-nuxt-context it seems that API methods have to be prefixed with $, however it results in 500 error (_ctx.$localePath is not a function).

This works, but shows type error in VSCode
Screenshot 2023-06-17 at 02 12 33

This does not work and results in 500 error
Screenshot 2023-06-17 at 02 12 47

This does work
Screenshot 2023-06-17 at 02 13 02

Additional context

No response

Logs

No response

@kazupon kazupon added v8 ❗ p4-important Priority 4: bugs that violate documented behavior, or significantly impact perf pending triage good first issue PR Welcome API and removed pending triage labels Jun 20, 2023 — with Volta.net
@kazupon kazupon added 🔨 p3-minor-bug Priority 3: a bug in an edge case that only affects very specific usage and removed ❗ p4-important Priority 4: bugs that violate documented behavior, or significantly impact perf labels Jul 20, 2023 — with Volta.net
@fabkho
Copy link

fabkho commented Oct 16, 2023

any updates on this? Having the same problem...

As a workaround i use <nuxt-link-locale>, which just works.
Components · @nuxtjs/i18n

@antlionguard
Copy link

still same problem exist if $localePath used outside of setup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API good first issue 🔨 p3-minor-bug Priority 3: a bug in an edge case that only affects very specific usage PR Welcome v8 v9
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants