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

Bug: 10.0.1 build error after upgrade (+ unplugin-vue-i18n 5.0.0) #393

Open
4 tasks done
volarname opened this issue Sep 19, 2024 · 7 comments
Open
4 tasks done

Bug: 10.0.1 build error after upgrade (+ unplugin-vue-i18n 5.0.0) #393

volarname opened this issue Sep 19, 2024 · 7 comments
Labels

Comments

@volarname
Copy link

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

@volarname volarname added the Status: Review Needed Request for review comments label Sep 19, 2024
@kazupon
Copy link
Member

kazupon commented Sep 21, 2024

Thank you for your reporting!
This issue is not vue-i18n, unplugin-vue-i18n
so I'll move this issue

@kazupon kazupon transferred this issue from intlify/vue-i18n Sep 21, 2024
@nielsvanvelzen
Copy link

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?

@Soviut
Copy link

Soviut commented Oct 4, 2024

@nielsvanvelzen how are you manually adding a newer version of unplugin?

@nielsvanvelzen
Copy link

Just install it as an additional dependency in your project: npm i -D unplugin@latest.

@volarname
Copy link
Author

volarname commented Oct 7, 2024

@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

@AdamVig
Copy link

AdamVig commented Oct 16, 2024

This was introduced in d0064c8, specifically this line of the diff, released in 5.0.0-beta.5. 5.0.0-beta.4 does not exhibit this issue.

@Soviut
Copy link

Soviut commented Oct 16, 2024

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_modules
  • npm install
  • npm install vue-tsc@latest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants