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

SyntaxError: Named export 'LOCATION_STUB' not found. The requested module '@intlify/message-compiler' is a CommonJS module, #2139

Closed
4 tasks done
LukerSpringtree opened this issue Mar 19, 2025 · 3 comments
Labels
Status: Review Needed Request for review comments

Comments

@LukerSpringtree
Copy link

Reporting a bug?

failed to load config from C:\Users\lde1wx\bosch\bak\V3-T\vite.config.ts
error when starting dev server:
file:///C:/Users/lde1wx/bosch/bak/V3-T/node_modules/.pnpm/@intlify+bundle-utils@10.0._5bcf99746951c1e1f08ddfe8235206a1/node_modules/@intlify/bundle-utils/lib/index.mjs:4
import { LOCATION_STUB, detectHtmlTag, baseCompile } from '@intlify/message-compiler';
^^^^^^^^^^^^^
SyntaxError: Named export 'LOCATION_STUB' not found. The requested module '@intlify/message-compiler' is a CommonJS module, which may not support all module.exports as named exports.
CommonJS modules can always be imported via the default export, for example using:

import pkg from '@intlify/message-compiler';
const { LOCATION_STUB, detectHtmlTag, baseCompile } = pkg;

at ModuleJob._instantiate (node:internal/modules/esm/module_job:132:21)
at async ModuleJob.run (node:internal/modules/esm/module_job:214:5)
at async ModuleLoader.import (node:internal/modules/esm/loader:329:24)
at async loadConfigFromBundledFile (file:///C:/Users/lde1wx/bosch/bak/V3-T/node_modules/.pnpm/vite@6.2.1_@types+node@22.1_d7fc9abb92f3057f431307e2da04e78f/node_modules/vite/dist/node/chunks/dep-glQox-ep.js:54618:15)
at async bundleAndLoadConfigFile (file:///C:/Users/lde1wx/bosch/bak/V3-T/node_modules/.pnpm/vite@6.2.1_@types+node@22.1_d7fc9abb92f3057f431307e2da04e78f/node_modules/vite/dist/node/chunks/dep-glQox-ep.js:54461:22)
at async loadConfigFromFile (file:///C:/Users/lde1wx/bosch/bak/V3-T/node_modules/.pnpm/vite@6.2.1_@types+node@22.1_d7fc9abb92f3057f431307e2da04e78f/node_modules/vite/dist/node/chunks/dep-glQox-ep.js:54423:44)
at async resolveConfig (file:///C:/Users/lde1wx/bosch/bak/V3-T/node_modules/.pnpm/vite@6.2.1_@types+node@22.1_d7fc9abb92f3057f431307e2da04e78f/node_modules/vite/dist/node/chunks/dep-glQox-ep.js:53931:24)
at async _createServer (file:///C:/Users/lde1wx/bosch/bak/V3-T/node_modules/.pnpm/vite@6.2.1_@types+node@22.1_d7fc9abb92f3057f431307e2da04e78f/node_modules/vite/dist/node/chunks/dep-glQox-ep.js:43843:18)
at async CAC.<anonymous> (file:///C:/Users/lde1wx/bosch/bak/V3-T/node_modules/.pnpm/vite@6.2.1_@types+node@22.1_d7fc9abb92f3057f431307e2da04e78f/node_modules/vite/dist/node/cli.js:750:20)

 ELIFECYCLE  Command failed with exit code 1.

Expected behavior

I can't start, I tried many versions of vue-i18n, but it is always wrong

Reproduction

SyntaxError: Named export 'LOCATION_STUB' not found. The requested module '@intlify/message-compiler' is a CommonJS module,

System Info

System:
    OS: Windows 11 10.0.22631
    CPU: (16) x64 11th Gen Intel(R) Core(TM) i7-11850H @ 2.50GHz
    Memory: 6.70 GB / 31.67 GB
  Binaries:
    Node: 20.10.0 - C:\Program Files\nodejs\node.EXE
    npm: 10.2.3 - C:\Program Files\nodejs\npm.CMD
    pnpm: 10.6.2 - ~\AppData\Local\pnpm\pnpm.CMD
  Browsers:
    Edge: Spartan (Active code page: 65001), Chromium (127.0.2651.74), ChromiumDev (Active code page: 65001)
    Internet Explorer: 11.0.22621.3527
  npmPackages:
    @intlify/unplugin-vue-i18n: ^6.0.3 => 6.0.3
    @vitejs/plugin-vue: ^5.2.1 => 5.2.1
    @vitejs/plugin-vue-jsx: ^4.1.1 => 4.1.1
    vite: ^6.2.1 => 6.2.1
    vite-plugin-cdn-import: ^1.0.1 => 1.0.1
    vite-plugin-compression: ^0.5.1 => 0.5.1
    vite-plugin-remove-console: ^2.2.0 => 2.2.0
    vite-plugin-restart: ^0.4.2 => 0.4.2
    vite-plugin-router-warn: ^1.0.0 => 1.0.0
    vite-plugin-vue-devtools: ^7.7.2 => 7.7.2
    vite-svg-loader: ^5.1.0 => 5.1.0
    vue: ^3.5.13 => 3.5.13
    vue-eslint-parser: ^10.1.1 => 10.1.1
    vue-i18n: v10.0.6 => 10.0.6
    vue-router: ^4.5.0 => 4.5.0

Screenshot

Additional context

1

Validations

@LukerSpringtree LukerSpringtree added the Status: Review Needed Request for review comments label Mar 19, 2025
@nuth-vireak
Copy link

I also face this issue too

import { LOCATION_STUB, detectHtmlTag, baseCompile } from '@intlify/message-compiler';
         ^^^^^^^^^^^^^
SyntaxError: Named export 'LOCATION_STUB' not found. The requested module '@intlify/message-compiler' is a CommonJS module, which may not support all module.exports as named exports.
CommonJS modules can always be imported via the default export, for example using:

import pkg from '@intlify/message-compiler';
const { LOCATION_STUB, detectHtmlTag, baseCompile } = pkg;

@liuk123456789
Copy link

liuk123456789 commented Mar 19, 2025

Me too !!! The project can't start Now

Image

@kazupon

@kazupon
Copy link
Member

kazupon commented Mar 19, 2025

I've just released out @intlify/unplugin-vue-i18n@6.0.5
https://github.com/intlify/bundle-tools/releases/tag/unplugin-vue-i18n%406.0.5

please check it out!

@kazupon kazupon closed this as completed Mar 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Review Needed Request for review comments
Projects
None yet
Development

No branches or pull requests

4 participants