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

SyntaxError: Unexpected return type in composer #400

Open
4 tasks done
lubuger opened this issue Nov 1, 2024 · 1 comment
Open
4 tasks done

SyntaxError: Unexpected return type in composer #400

lubuger opened this issue Nov 1, 2024 · 1 comment
Labels
Status: Need More Info Lacks enough info to make progress

Comments

@lubuger
Copy link

lubuger commented Nov 1, 2024

Reporting a bug?

ussing t function in composition API returns error.
tm(summer):
{ "type": 0, "start": 0, "end": 6, "loc": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 7, "offset": 6 }, "source": "Summer" }, "body": { "type": 2, "start": 0, "end": 6, "loc": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 7, "offset": 6 } }, "items": [ { "type": 3, "start": 0, "end": 6, "loc": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 7, "offset": 6 } } } ], "static": "Summer" } }

te('summer')
true

t('summer')
SyntaxError: Unexpected return type in composer

Expected behavior

function t should work

Reproduction

vite.config.js

VueI18nPlugin({
        include: resolve(dirname(fileURLToPath(import.meta.url)), './resources/js/locales/**'),
}),

app.js

const i18n = createI18n({
    legacy: false,
    locale: 'en',
    messages
});

Show.vue

<script setup>
import { useI18n } from 'vue-i18n';

const { t, tm, te } = useI18n();
</script>

<template>
{{ tm(`summer`) }}
{{ te('summer') }}
<p>{{ t('summer') }}</p>
</template>

Issue Package

vite-plugin-vue-i18n

System Info

System:
    OS: Linux 6.8 Ubuntu 24.04.1 LTS 24.04.1 LTS (Noble Numbat)
    CPU: (4) x64
    Memory: 1.69 GB / 3.81 GB
    Container: Yes
    Shell: 5.2.21 - /bin/bash
  Binaries:
    Node: 18.19.1 - /usr/bin/node
    npm: 9.2.0 - /usr/bin/npm
  Browsers:
    Chromium: 130.0.6723.69
  npmPackages:
    vite: ^5.4.10 => 5.4.10 
    vue: ^3.5.12 => 3.5.12 
    vue-i18n: ^9.14.1 => 9.14.1

Screenshot

No response

Additional context

No response

Validations

  • Read the Contributing Guidelines.
  • Read the README
  • 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 open a GitHub Discussion.
@lubuger lubuger added the Status: Review Needed Request for review comments label Nov 1, 2024
@kazupon kazupon added the Status: Need More Info Lacks enough info to make progress label Nov 7, 2024
@kazupon
Copy link
Member

kazupon commented Nov 7, 2024

Thank you for your reporting!

This repository has issue guidline.

Please provide a link to a repo that can reproduce the problem you ran into. A minimal reproduction is required (Why?). If a report is vague (e.g. just a generic error message) and has no reproduction, it will receive a "Status: Need More Info" label. If no reproduction is provided after 5 days, it will be closed.

https://github.com/intlify/bundle-tools/blob/main/.github/ISSUE_TEMPLATE/bug-report.yml

Could you give a minimal reproduction, please ? 🙏

@kazupon kazupon removed the Status: Review Needed Request for review comments label Nov 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Need More Info Lacks enough info to make progress
Projects
None yet
Development

No branches or pull requests

2 participants