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

fix: transform resources failing when autoImport is disabled #2426

Merged

Conversation

BobbieGoede
Copy link
Collaborator

@BobbieGoede BobbieGoede commented Sep 19, 2023

πŸ”— Linked issue

#2151
#2182

❓ Type of change

  • πŸ“– Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

Resolves #2151
Resolves #2182

The core of these issues seems to be that defineI18nLocale or defineI18nConfig are only removed once, but with autoImport disabled a file will usually contain the string multiple times.

This happened with autoImport disabled.

import { } from "#i18n";
export default defineI18nConfig(() => ({}));

My change results in:

import { } from "#i18n";
export default (() => ({}));

Which still looks odd but seems to work fine!

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@BobbieGoede BobbieGoede self-assigned this Sep 19, 2023
@BobbieGoede BobbieGoede marked this pull request as ready for review September 19, 2023 22:08
@BobbieGoede BobbieGoede force-pushed the fix/auto-import-disabled-resources branch from 797d4ea to d1b05a4 Compare September 19, 2023 22:09
Copy link
Collaborator

@kazupon kazupon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job! πŸ‘
LGTM!

@kazupon kazupon merged commit 568c274 into nuxt-modules:next Sep 20, 2023
5 checks passed
DarthGigi pushed a commit to DarthGigi/i18n that referenced this pull request Apr 16, 2024
…modules#2426)

* fix: transform resources failing when `autoImport` is disabled

* test: assert that locale and config resources work with `autoImport` disabled
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Import of defineI18nConfig fails Locale messages are not generated with disabled autoImport nuxt setting
2 participants