Skip to content

<i18n-t> crashes when using some combination of slots #2189

@davidwessman

Description

@davidwessman

Reporting a bug?

    <i18n-t tag="div" keypath="with_double_slot">
      <template #a>
        <h1>a</h1>
      </template>

      <template #blaha>
        <h1>b</h1>
      </template>

      <template> test </template>
    </i18n-t>

crashes with

.localservice@runtime.55edb8f4.js:26 TypeError: slot is not a function
    at vue-i18n.js?v=664abfb0:4857:20
    at Array.reduce (<anonymous>)
    at getInterpolateArg (vue-i18n.js?v=664abfb0:4854:17)
    at Proxy.<anonymous> (vue-i18n.js?v=664abfb0:4896:19)
    at renderComponentRoot (chunk-GNBNPM2D.js?v=0636b056:8679:17)
    at ReactiveEffect.componentUpdateFn [as fn] (chunk-GNBNPM2D.js?v=0636b056:7550:26)
    at ReactiveEffect.run (chunk-GNBNPM2D.js?v=0636b056:494:19)
    at updateComponent (chunk-GNBNPM2D.js?v=0636b056:7411:18)
    at processComponent (chunk-GNBNPM2D.js?v=0636b056:7345:7)
    at patch (chunk-GNBNPM2D.js?v=0636b056:6849:11)
console.<computed> @ .localservice@runtime.55edb8f4.js:26
(anonymous) @ chunk-GNBNPM2D.js?v=0636b056:2653
(anonymous) @ App.vue?t=1748009367613:157
(anonymous) @ client.ts:559
(anonymous) @ client.ts:476
(anonymous) @ client.ts:323
queueUpdate @ client.ts:323
await in queueUpdate
(anonymous) @ client.ts:176
handleMessage @ client.ts:174
(anonymous) @ client.ts:91
dispatchEvent @ .localservice@runtime.55edb8f4.js:26
_handleMessage @ .localservice@runtime.55edb8f4.js:26
_0x51e611 @ .localservice@runtime.55edb8f4.js:26
App.vue?t=1748009367613:157 [HMR] Something went wrong during Vue component hot-reload. Full reload required.
(anonymous) @ chunk-GNBNPM2D.js?v=0636b056:2654
(anonymous) @ App.vue?t=1748009367613:157
(anonymous) @ client.ts:559
(anonymous) @ client.ts:476
(anonymous) @ client.ts:323
queueUpdate @ client.ts:323
await in queueUpdate
(anonymous) @ client.ts:176
handleMessage @ client.ts:174
(anonymous) @ client.ts:91
dispatchEvent @ .localservice@runtime.55edb8f4.js:26
_handleMessage @ .localservice@runtime.55edb8f4.js:26
_0x51e611 @ .localservice@runtime.55edb8f4.js:26

Expected behavior

It should not crash

Reproduction

https://stackblitz.com/edit/vitejs-vite-2iqhu9uf?file=src%2FApp.vue,src%2Fmain.ts,package.json,package-lock.json

System Info

System:
    OS: Linux 5.0 undefined
    CPU: (8) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
    Memory: 0 Bytes / 0 Bytes
    Shell: 1.0 - /bin/jsh
  Binaries:
    Node: 20.19.1 - /usr/local/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 10.8.2 - /usr/local/bin/npm
    pnpm: 8.15.6 - /usr/local/bin/pnpm
  npmPackages:
    @vitejs/plugin-vue: ^4.2.3 => 4.3.4 
    vite: ^4.4.9 => 4.4.9 
    vue: 3.5.14 => 3.5.14 
    vue-i18n: 11.1.3 => 11.1.3 
    vue-tsc: ^1.8.8 => 1.8.10

Screenshot

Image

Additional context

Probably related to #2167 but I have not managed to fix it.
This change in Vue has been merged and released:
vuejs/core#13215

Validations

Metadata

Metadata

Assignees

No one assigned

    Labels

    ❗ p4-importantPriority 4: bugs that violate documented behavior, or significantly impact perf

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions