I was using vuex 1.0.0-rc, and recently upgraded to 1.0.0
import createLogger from 'vuex/logger';
On trying to use createLogger plugin, I get this warning:
Module not found: Error: Cannot resolve module 'vuex/logger'
logger.js used to be inside root directory of /vuex, but now it is neither there or in /vuex/dist like in vuex 2.0.0.
Hmm, the build script on 1.0 branch is not changed so we should able to load it but it's not in node_modules/vuex...
/ping @yyx990803
I ran into the same problem now. Somehow the version I was using before isn't working anymore.
Version 1.0.0-rc.2 worked for me before but stopped working after a new npm install today.
Trying to fix it. Can anyone confirm dist/logger.js has ever existed?
I believe it has todo with the build process and what will be sent to the npm registry.
I've downloaded both vuex-1.0.0-rc.2.tgz and vuex-1.0.0.tgz and looked into it.
âš¡ tar xvfz vuex-1.0.0-rc.2.tgz
x package/package.json
x package/LICENSE
x package/logger.js
x package/dist/vuex.js
x package/dist/vuex.min.js
x package/src/index.js
x package/src/override.js
x package/src/util.js
x package/src/plugins/devtool.js
x package/src/plugins/logger.js
âš¡ tar xvfz vuex-1.0.0.tgz
x package/package.json
x package/README.md
x package/LICENSE
x package/dist/vuex.js
x package/dist/vuex.min.js
x package/logger.d.ts
x package/src/index.js
x package/src/override.js
x package/src/util.js
x package/src/plugins/devtool.js
x package/src/plugins/logger.js
x package/types/README.md
x package/types/index.d.ts
x package/types/vue.d.ts
As you can see here package/logger.js is missing in the 1.0.0 built.
I've pushed nerdyglasses-vuex with version 1.0.0 to npm.
logger.js is present there.
You have two options to hotfix this for now.
Download logger.js and place it into your node_modules/vuex folder
Or reference the package I've created in your project until it has been fixed in the official repo.
https://www.npmjs.com/package/nerdyglasses-vuex
Best,
Christian
UPDATE 1:
You can add an alias to webpack so that so don't have to touch your app files to resolve to nerdyglasses-vuex.
module.exports = {
resolve: {
alias: {
'vuex': rootDir + '/node_modules/nerdyglasses-vuex'
}
}
}
same here. A new npm install broke my current version
@yyx990803 Can we release v1.0.1 that include logger.js?
Actually it would be better to republish version 1.0.0 since the code doesn't change.
It doesn't change the code at all.
It just a mistakenly missing file in the publish process.
In my understanding, we cannot republish same version more twice to npm. We can only do publish new version.
oh you're referring to this: http://blog.npmjs.org/post/77758351673/no-more-npm-publish-f
I didn't publish something for a long time. so you're right.
But it might be good to unpublish version 1.0.0 then.
Never unpublish. npm should remove that functionality totally. Just publish a new version and leave this bug as history.
@mlaccetti I'm curious why you have that opinion.
@nerdyglasses google "npm left pad chaos" 😂
/ping @yyx990803
Fixed in 1.0.1
Most helpful comment
@nerdyglasses google "npm left pad chaos" 😂