Skip to content

useTranslation errors when used inside a Nitro request hook #23

Description

@GalacticHypernova

Describe the bug

When used inside a Nitro request hook, useTranslation (for server-side translation) errors:
image

Reproduction

nitroApp.hooks.hook("request", async (event) => { const t = await useTranslation(event) })

System Info

------------------------------
- Operating System: Linux
- Node Version:     v21.1.0
- Nuxt Version:     3.11.2
- CLI Version:      3.12.0
- Nitro Version:    2.9.6
- Package Manager:  yarn@4.0.0
- Builder:          -
- User Config:      nitro, i18n, devtools, runtimeConfig, experimental, vite
- Runtime Modules:  @nuxtjs/i18n@8.3.1
- Build Modules:    -
------------------------------

Used Package Manager

n/a

Additional context

The reproduction provided is extremely minimal as that's all that needs to be done in order to trigger the error. If necessary, I can provide a less minimal reproduction, please do let me know!

Validations

  • Follow our Code of Conduct
  • Read the Contributing Guide.
  • 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, please open a GitHub Discussion instead.
  • The provided reproduction is a minimal reproducible of the bug.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions