Skip to content

<fluent> blocks not processed during testing #954

@ranisalt

Description

@ranisalt

Describe the bug

I'm using fluent-vue via the official unplugin-fluent-vue/nuxt module in a Nuxt 4 project. The blocks defined inside single-file Vue components work correctly in development and production.

However, when running unit tests (using @nuxt/test-utils and Vitest), the translations are not rendered. Instead of translated strings, the raw keys appear in the DOM.

What I tried:

  • Configured the plugin via unplugin-fluent-vue/nuxt
  • Ensured fluentVue.sfc is set in nuxt.config.ts
  • Manually added SFCFluentPlugin({ blockType: 'fluent' }) to vite.plugins (makes no difference)
  • Cleared .nuxt, node_modules, cache, etc.
  • Confirmed the plugin executes in development and console logs show it's active (can be checked in the reproduction below)

Reproduction

https://stackblitz.com/edit/nuxt-starter-wuys3u6q?view=editor

System Info

System:
    OS: Linux 6.15 Arch Linux
    CPU: (16) x64 AMD Ryzen 7 9800X3D 8-Core Processor
    Memory: 7.58 GB / 31.00 GB
    Container: Yes
    Shell: 4.0.2 - /usr/bin/fish
  Binaries:
    Node: 22.17.1 - ~/.local/share/asdf/installs/nodejs/22.17.1/bin/node
    npm: 10.9.2 - ~/.local/share/asdf/plugins/nodejs/shims/npm
    pnpm: 10.12.4 - ~/.local/share/npm/bin/pnpm
  npmPackages:
    fluent-vue: ^3.7.2 => 3.7.2
    unplugin-fluent-vue: ^1.4.1 => 1.4.1

Validations

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions