intlify / bundle-tools

bundling for intlify i18n tools
MIT License
244 stars 37 forks source link

Does not work in Vite #389

Closed CharleeWa closed 4 months ago

CharleeWa commented 4 months ago

Reporting a bug?

hi @kazupon, When attempting to run pnpm dev, I encountered an error message: No known conditions for "./messages" specifier in "@intlify/unplugin-vue-i18n" package.

Expected behavior

I hope everything runs fine.

Reproduction

https://github.com/easy-temps/vue3-vant-mobile/tree/main

Issue Package

unplugin-vue-i18n

System Info

System:
    OS: macOS 14.5
    CPU: (8) arm64 Apple M1 Pro
    Memory: 183.61 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.12.2 - ~/.nvm/versions/node/v20.12.2/bin/node
    npm: 10.5.0 - ~/.nvm/versions/node/v20.12.2/bin/npm
    pnpm: 9.5.0 - ~/Library/pnpm/pnpm
  Browsers:
    Chrome: 126.0.6478.183
    Safari: 17.5
  npmPackages:
    rollup: ^4.18.1 => 4.19.0 
    vite: ^5.3.4 => 5.3.4 
    vue: ^3.4.33 => 3.4.33 
    vue-i18n: ^9.13.1 => 9.13.1

Screenshot

1、 WeChat10265484abed1dfb8514f0d862ceefc1

2、 WeChatfc77f18676dd35f6e8931da0392abc28

Additional context

No response

Validations

CharleeWa commented 4 months ago

New developments on this issue: it seems related to my upgrade of the unplugin-auto-import plugin to version 0.18.0. Upon reviewing the source code, the plugin's author set the default value of viteOptimizeDeps to true, which might be the cause of the problem. I'm not sure if this should be fixed. For now, I'll set viteOptimizeDeps to false to resolve the issue.

https://github.com/unplugin/unplugin-auto-import/commit/3a27e14

CharleeWa commented 4 months ago

This is resolved by upgrading unplugin-auto-import to 0.18.1