Vite: Uncaught SyntaxError: The requested module '/@modules/vuex/dist/logger' does not provide an export named 'default'

Created on 3 Jun 2020  路  10Comments  路  Source: vitejs/vite

System Info

  • required vite version: ^0.20.2
  • required Operating System:
  • required Node version: v12.14.1
  • Optional:

    • npm/yarn version [email protected]

    • Installed vue version (from yarn.lock or package-lock.json)

    • Installed @vue/compiler-sfc version

import createLogger from 'vuex/dist/logger';

Uncaught SyntaxError: The requested module '/@modules/vuex/dist/logger' does not provide an export named 'default'

pending triage

Most helpful comment

Hmm, this is a problem in vuex@next. We need an ESM dist for the logger. /cc @kiaking

All 10 comments

Not a "vuex/dist/logger" issue? I've got piles of such errors.

What about optimizeDeps.exclude?:

optimizeDeps: {
  exclude: ['vuex']
}

What about optimizeDeps.exclude?:

optimizeDeps: {
  exclude: ['vuex']
}

still console this error Uncaught SyntaxError: The requested module '/@modules/vuex/dist/logger' does not provide an export named 'default'
It doesn't work

Not a "vuex/dist/logger" issue? I've got piles of such errors.

The problem does not occur when using vue/cli

Is it under dependencies or devDependencies? Maybe #162, #174 or #240 could help.

under the dependencies

"dependencies": {
    "vuex": "^4.0.0-beta.2"

For umd modules.You can add blew code into vite.config.js

 optimizeDeps: {
    include: ['vuex/dist/logger']
  }

thanks @underfin

Hmm, this is a problem in vuex@next. We need an ESM dist for the logger. /cc @kiaking

Oh OK. Indeed we only have 1 build for logger so we should create same build types as Vue and Vuex then. I'll work on to it 馃憤

Was this page helpful?
0 / 5 - 0 ratings

Related issues

cmwhited picture cmwhited  路  3Comments

jakobrosenberg picture jakobrosenberg  路  3Comments

maxxcs picture maxxcs  路  3Comments

robrich picture robrich  路  4Comments

cyberalien picture cyberalien  路  3Comments