bundle-tools
bundle-tools copied to clipboard
Bug: 10.0.1 build error after upgrade (+ unplugin-vue-i18n 5.0.0)
Reporting a bug?
failed to load config from /home/user/projects/anzusystems/common-admin/vite.config.lib.ts
error during build:
file:///home/user/projects/anzusystems/common-admin/node_modules/@intlify/unplugin-vue-i18n/lib/vite.mjs:1
import { createVitePlugin } from 'unplugin';
^^^^^^^^^^^^^^^^
SyntaxError: The requested module 'unplugin' does not provide an export named 'createVitePlugin'
at ModuleJob._instantiate (node:internal/modules/esm/module_job:131:21)
at async ModuleJob.run (node:internal/modules/esm/module_job:213:5)
at async ModuleLoader.import (node:internal/modules/esm/loader:316:24)
at async loadConfigFromBundledFile (file:///home/user/projects/anzusystems/common-admin/node_modules/vite/dist/node/chunks/dep-DyBnyoVI.js:66633:15)
at async loadConfigFromFile (file:///home/user/projects/anzusystems/common-admin/node_modules/vite/dist/node/chunks/dep-DyBnyoVI.js:66474:24)
at async resolveConfig (file:///home/user/projects/anzusystems/common-admin/node_modules/vite/dist/node/chunks/dep-DyBnyoVI.js:66082:24)
at async build (file:///home/user/projects/anzusystems/common-admin/node_modules/vite/dist/node/chunks/dep-DyBnyoVI.js:65179:18)
at async CAC.<anonymous> (file:///home/user/projects/anzusystems/common-admin/node_modules/vite/dist/node/cli.js:828:5)
Expected behavior
project should build without error
Reproduction
https://github.com/anzusystems/common-admin/tree/i18n-bug
clone i18n-bug branch
run yarn build
System Info
System:
OS: Linux 5.15 Ubuntu 22.04.3 LTS 22.04.3 LTS (Jammy Jellyfish)
CPU: (4) x64 13th Gen Intel(R) Core(TM) i9-13900HX
Memory: 3.29 GB / 15.62 GB
Container: Yes
Shell: 5.1.16 - /bin/bash
Binaries:
Node: 20.9.0 - ~/.nvm/versions/node/v20.9.0/bin/node
Yarn: 4.5.0 - ~/.nvm/versions/node/v20.9.0/bin/yarn
npm: 10.1.0 - ~/.nvm/versions/node/v20.9.0/bin/npm
npmPackages:
@intlify/unplugin-vue-i18n: ^5.0.0 => 5.0.0
@vitejs/plugin-vue: ^5.1.4 => 5.1.4
@vue/eslint-config-prettier: ^9.0.0 => 9.0.0
@vue/eslint-config-typescript: ^13.0.0 => 13.0.0
@vue/tsconfig: ^0.5.1 => 0.5.1
vite: 5.4.6 => 5.4.6
vite-plugin-dts: ^4.1.1 => 4.1.1
vite-plugin-vuetify: ^2.0.4 => 2.0.4
vitepress: 1.3.4 => 1.3.4
vue: 3.5.6 => 3.5.6
vue-i18n: 10.0.1 => 10.0.1
vue-router: 4.4.5 => 4.4.5
vue-tsc: 2.1.6 => 2.1.6
vuetify: 3.7.2 => 3.7.2
Screenshot
No response
Additional context
No response
Validations
- [X] Read the Contributing Guidelines
- [X] Read the Documentation
- [X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- [X] Check that this is a concrete bug. For Q&A open a GitHub Discussions
Thank you for your reporting! This issue is not vue-i18n, unplugin-vue-i18n so I'll move this issue
I'm also affected by this issue and looked into it. The dependency on unplugin is set to ^1.1.0 but the createVitePlugin (and other createXPlugin) functions were added in version 1.3.2 (https://github.com/unjs/unplugin/blob/main/CHANGELOG.md#132-2023-07-03). Manually adding a newer version of unplugin to my project fixes the issue. So I guess the fix here would be to bump the requires version in unplugin-vue-i18n?
@nielsvanvelzen how are you manually adding a newer version of unplugin?
Just install it as an additional dependency in your project: npm i -D unplugin@latest.
@nielsvanvelzen thx, i can confirm adding newer version of unplugin solved the issue, bump up the version in unplugin-vue-i18n package should fix this issue
This was introduced in d0064c84a570e3133302803e015ae2552ca2a82a, specifically this line of the diff, released in 5.0.0-beta.5. 5.0.0-beta.4 does not exhibit this issue.
Just install it as an additional dependency in your project:
npm i -D unplugin@latest.
Thanks, that did help with type errors in the console on startup.
I was still getting a strange type error where $t wasn't recognized in VSCode but the solution to that was to
- delete
package-lock.json rm -rf node_modulesnpm installnpm install vue-tsc@latest
solved the issue, bump up the version in unplugin-vue-i18n package should fix this issue
Is there any update on when the updated dependency will be released?
still not fixed???
With the workaround discovered by @nielsvanvelzen, you can also specify an override in your package.json:
"overrides": {
"@intlify/unplugin-vue-i18n": {
"unplugin": "^1.3.2"
}
},
I believe that this issue is fixed. because the version of unplugin is ^2.2.0.
https://github.com/intlify/bundle-tools/blob/0e2959a6ae4228747e109f8057802755d88a4f29/packages/unplugin-vue-i18n/package.json#L36
I'll close this issue. Thanks!