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

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

Closed
jimizai opened this issue Jun 3, 2020 · 10 comments

Comments

@jimizai
Copy link

jimizai commented Jun 3, 2020

System Info

  • required vite version: ^0.20.2
  • required Operating System:
  • required Node version: v12.14.1
  • Optional:
    • npm/yarn version yarn@1.22.4
    • 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'

@AngusFu
Copy link
Contributor

AngusFu commented Jun 3, 2020

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

@m4rvr
Copy link
Contributor

m4rvr commented Jun 3, 2020

What about optimizeDeps.exclude?:

optimizeDeps: {
  exclude: ['vuex']
}

@jimizai
Copy link
Author

jimizai commented Jun 3, 2020

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

@jimizai
Copy link
Author

jimizai commented Jun 3, 2020

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

The problem does not occur when using vue/cli

@m4rvr
Copy link
Contributor

m4rvr commented Jun 3, 2020

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

@jimizai
Copy link
Author

jimizai commented Jun 3, 2020

under the dependencies

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

@underfin
Copy link
Member

underfin commented Jun 4, 2020

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

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

@jimizai
Copy link
Author

jimizai commented Jun 4, 2020

thanks @underfin

@jimizai jimizai closed this as completed Jun 4, 2020
@yyx990803
Copy link
Member

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

@kiaking
Copy link
Contributor

kiaking commented Jun 5, 2020

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 👍

kiaking added a commit to vuejs/vuex that referenced this issue Jun 24, 2020
ktsn pushed a commit to vuejs/vuex that referenced this issue Jun 26, 2020
@github-actions github-actions bot locked and limited conversation to collaborators Jul 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants