Skip to content

fix: support vite 8#2474

Open
Mythie wants to merge 1 commit intolingui:mainfrom
Mythie:main
Open

fix: support vite 8#2474
Mythie wants to merge 1 commit intolingui:mainfrom
Mythie:main

Conversation

@Mythie
Copy link

@Mythie Mythie commented Mar 12, 2026

Summary

  • Add moduleType: "js" to the transform hook return value so Rolldown knows .po files are being compiled to JS
  • Add ^8 to the vite peer dependency range

Problem

Vite 8 switched to Rolldown which auto-detects module types by file extension. .po files get assigned a non-JS module type, so when the plugin compiles them to ES modules, Rolldown chokes with TypeError: Cannot convert undefined or null to object.

Fixes #2473

What changed

packages/vite-plugin/src/index.ts — added moduleType: "js" to transform return. This is a standard Rolldown/Vite 8 convention documented in the migration guide. Safely ignored by older Vite versions.

packages/vite-plugin/package.json — peer dep vite now includes ^8.

Testing

All 9 existing tests pass. The moduleType property is ignored by Vite 3-7 so this is backwards compatible.

Also tested by patching https://github.com/documenso/documenso and running vite build over there when attempting the Vite@8 upgrade.

@vercel
Copy link

vercel bot commented Mar 12, 2026

@Mythie is attempting to deploy a commit to the Crowdin Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

@lingui/vite-plugin - support for vite 8

1 participant