Skip to content

[Bug] orgTransform.apply is not a function - Loading json makes i18n fail in Vite 6.3.0Β #483

@jurgensweere

Description

@jurgensweere

Reporting a bug?

When you try to load additional json files in your project, not related to i18n, you get this error when using Vite 6.3.0

12:15:01 [vite] (client) Pre-transform error: orgTransform.apply is not a function
  Plugin: vite:json
  File: /home/projects/vitejs-vite-inmkmjbn/src/some.json
12:15:01 [vite] Internal server error: orgTransform.apply is not a function
  Plugin: vite:json
  File: /home/projects/vitejs-vite-inmkmjbn/src/some.json
      at jsonPlugin.transform (file:///home/projects/vitejs-vite-inmkmjbn/node_modules/@intlify/unplugin-vue-i18n/lib/index.mjs:278:33)
      at EnvironmentPluginContainer.transform (file:///home/projects/vitejs-vite-inmkmjbn/node_modules/vite/dist/node/chunks/dep-BuM4AdeL.js:42275:19)
      at async loadAndTransform (file:///home/projects/vitejs-vite-inmkmjbn/node_modules/vite/dist/node/chunks/dep-BuM4AdeL.js:35732:27)
      at async viteTransformMiddleware (file:///home/projects/vitejs-vite-inmkmjbn/node_modules/vite/dist/node/chunks/dep-BuM4AdeL.js:37230:24)

Expected behavior

No errors occurs

Reproduction

https://stackblitz.com/edit/vitejs-vite-inmkmjbn?file=src%2Frouter%2Findex.js&terminal=dev

Issue Package

unplugin-vue-i18n

System Info

System:
    OS: macOS 15.4
    CPU: (8) arm64 Apple M1 Pro
    Memory: 288.78 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 22.14.0 - ~/.nvm/versions/node/v22.14.0/bin/node
    npm: 10.9.2 - ~/.nvm/versions/node/v22.14.0/bin/npm
  Browsers:
    Chrome: 135.0.7049.95
    Edge: 135.0.3179.73
    Safari: 18.4
  npmPackages:
    vite: ^6.2.1 => 6.3.0 
    vue: ^3.4.27 => 3.5.13 
    vue-i18n: ^9.10.2 => 9.14.4

Screenshot

No response

Additional context

This might be due to the recently merged vitejs/vite#19586

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    improvementIncludes backwards-compatible fixes❗ 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