-
-
Notifications
You must be signed in to change notification settings - Fork 483
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
nuxt.hooks not working #1930
Comments
Hi, I'd like to ensure that the hooks are working fine so I'm really hoping to investigate further into this. Could you provide the source code of your plugin and/or a replication over Stackblitz please? Note: the change is available on edge-version. |
hi @ineshbose and thanks for the reply. There's a stackblitz replication. As you can see, while changing language, the Also, you can see the typescript errors that i mentioned in the I also did try the edge version as mentioned here but still the hooks don't trigger. |
Thanks for the replication - yes, it seems that the latest change has not been released on edge so the hooks aren't working. /cc @kazupon https://www.npmjs.com/package/@nuxtjs/i18n-edge/v/8.0.0-beta.10-27972923.f3bacb5?activeTab=readme Meanwhile, you can refer to v7 docs as the same for this purpose - https://v8.i18n.nuxtjs.org/guide/callbacks/#onbeforelanguageswitch |
Hi @TBioucasEAE, can you please check on edge if it works now? |
hi @ineshbose . I updated the version to edge, but still does not work. I also updated the replicate to the edge version, so you can check that the hooks still don't seem to work. |
@ineshbose yes, you are right. althougt the |
I can confirm now that after removing Many thanks for your suppor @ineshbose |
Environment
Node: v16.19.1
NPM: 9.6.1
Nuxt: 3.2.3 with Nitro 2.2.3
Module version: v8.0.0-beta.10
Reproduction
Create a
i18n.js
plugin as described in the documentation.Create a component with the following template:
Describe the bug
While navigating between languages, i expected to see the console.log() from
i18n.js
but nothing gets printed in the console.Also, when i change the file extension to
.ts
a typescript error shows up:Argument of type '"i18n:beforeLocaleSwitch"' is not assignable to parameter of type 'HookKeys<RuntimeNuxtHooks>';
Argument of type '"i18n:localeSwitched"' is not assignable to parameter of type 'HookKeys<RuntimeNuxtHooks>';
I checked that this PR was created in order to use these two hooks, but somehow they don't seem to work at all.
Additional context
No response
Logs
No response
The text was updated successfully, but these errors were encountered: