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

vite-plugin-vue-i18n does not provide an export named 'default' #157

Closed
4 tasks done
marekvospel opened this issue Aug 4, 2022 · 1 comment · Fixed by #158
Closed
4 tasks done

vite-plugin-vue-i18n does not provide an export named 'default' #157

marekvospel opened this issue Aug 4, 2022 · 1 comment · Fixed by #158

Comments

@marekvospel
Copy link
Contributor

marekvospel commented Aug 4, 2022

Reporting a bug?

When importing VueI18n plugin from @intlify/vite-plugin-vue-i18n from mjs context(default in create-vite since vitejs/vite@c3ec60c), the following import error is thrown when loading vite configuration.

failed to load config from /vite-vue-i18n-mjs-no-default/vite.config.ts
error during build:
file:///vite-vue-i18n-mjs-no-default/vite.config.ts.timestamp-1659644481699.mjs:4
import I18n from "@intlify/vite-plugin-vue-i18n";
       ^^^^
SyntaxError: The requested module '@intlify/vite-plugin-vue-i18n' does not provide an export named 'default'
    at ModuleJob._instantiate (node:internal/modules/esm/module_job:123:21)
    at async ModuleJob.run (node:internal/modules/esm/module_job:189:5)
    at async Promise.all (index 0)
    at async ESMLoader.import (node:internal/modules/esm/loader:541:24)
    at async loadConfigFromBundledFile (file:///vite-vue-i18n-mjs-no-default/node_modules/.pnpm/vite@3.0.4/node_modules/vite/dist/node/chunks/dep-71eb12cb.js:62893:21)
    at async loadConfigFromFile (file:///vite-vue-i18n-mjs-no-default/node_modules/.pnpm/vite@3.0.4/node_modules/vite/dist/node/chunks/dep-71eb12cb.js:62780:28)
    at async resolveConfig (file:///vite-vue-i18n-mjs-no-default/node_modules/.pnpm/vite@3.0.4/node_modules/vite/dist/node/chunks/dep-71eb12cb.js:62398:28)
    at async doBuild (file:///vite-vue-i18n-mjs-no-default/node_modules/.pnpm/vite@3.0.4/node_modules/vite/dist/node/chunks/dep-71eb12cb.js:43358:20)
    at async build (file:///vite-vue-i18n-mjs-no-default/node_modules/.pnpm/vite@3.0.4/node_modules/vite/dist/node/chunks/dep-71eb12cb.js:43347:16)
    at async CAC.<anonymous> (file:///vite-vue-i18n-mjs-no-default/node_modules/.pnpm/vite@3.0.4/node_modules/vite/dist/node/cli.js:747:9)
 ELIFECYCLE  Command failed with exit code 1.

Expected behavior

The plugin should have default export and shouldn't cause import error.

Reproduction

https://github.com/marekvospel/vite-vue-i18n-mjs-no-default

Issue Package

vite-plugin-vue-i18n

System Info

System:
    OS: Linux 5.18 Arch Linux
    CPU: (16) x64 AMD Ryzen 7 3700X 8-Core Processor
    Memory: 22.90 GB / 31.25 GB
    Container: Yes
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 18.6.0 - ~/.nvm/versions/node/v18.6.0/bin/node
    Yarn: 1.22.19 - /sbin/yarn
    npm: 8.13.2 - ~/.nvm/versions/node/v18.6.0/bin/npm
  Browsers:
    Chromium: 104.0.5112.79
    Firefox: 103.0.1
  npmPackages:
    @intlify/vite-plugin-vue-i18n: ^5.0.1 => 5.0.1 
    vite: ^3.0.4 => 3.0.4 
    vue: ^3.2.37 => 3.2.37 
    vue-i18n: 9 => 9.2.0

Screenshot

No response

Additional context

No response

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.
@marekvospel marekvospel added the Status: Review Needed Request for review comments label Aug 4, 2022
@kazupon kazupon added Type: Bug Bug or Bug fixes Package: vite-plugin-vue-i18n and removed Status: Review Needed Request for review comments labels Aug 5, 2022
@kazupon
Copy link
Member

kazupon commented Aug 5, 2022

Thank you for your kind reporting as always!
I've checked this issue.
I'll try to fix it!

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

Successfully merging a pull request may close this issue.

2 participants