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

__VUE_PROD_DEVTOOLS__ is not defined When SSR with prod mode #1991

Closed
cokemine opened this issue Jun 1, 2021 · 5 comments
Closed

__VUE_PROD_DEVTOOLS__ is not defined When SSR with prod mode #1991

cokemine opened this issue Jun 1, 2021 · 5 comments
Labels
4.x bug Something isn't working

Comments

@cokemine
Copy link
Contributor

cokemine commented Jun 1, 2021

Version

4.0.1

Reproduction link

https://github.com/cokemine/vuex-reproduce

Steps to reproduce

clone the repo.

yarn
yarn build
yarn start

What is expected?

prod mode works well like dev mode.

4.0.0 works normal

What is actually happening?

ReferenceError: VUE_PROD_DEVTOOLS is not defined

at Store.install (E:\vuex-reproduce\node_modules\vuex\dist\vuex.cjs.js:911:50)

@ysj151215
Copy link

I met this issue too.
My current solution is changing Vuex dependency version from "vuex": "^4.0.1" to "vuex": "4.0.0".

@cokemine
Copy link
Contributor Author

cokemine commented Jun 1, 2021

I met this issue too.
My current solution is changing Vuex dependency version from "vuex": "^4.0.1" to "vuex": "4.0.0".

Yes. 4.0.0 can work.
It because 4.0.1 added setup devtools integration, #1949.
As I mentioned in the PR, it seems that https://github.com/vuejs/vuex/blob/4.0/rollup.config.js#L64 is not correct

@kiaking kiaking added 4.x bug Something isn't working labels Jun 1, 2021
kiaking added a commit that referenced this issue Jun 1, 2021
…1991) (#1992)

fix #1991 

Co-authored-by: Kia King Ishii <kia.king.08@gmail.com>
@kiaking
Copy link
Member

kiaking commented Jun 1, 2021

Fixed by #1992 🎉

@kiaking kiaking closed this as completed Jun 1, 2021
@loremru
Copy link

loremru commented Jun 15, 2022

problem still exist, 4.0.0 is ok

@casadelaweb
Copy link

casadelaweb commented Jan 3, 2024

What bundler does your project use?

If it's webpack, try adding this into your webpack.config.ts / webpack.config.js

// import webpack
const webpack = require('webpack')
// OR import webpack from 'webpack' if the project supports ES Modules

// then add plugin to your configuration
plugins: [
  'your plugins ...',
  new webpack.DefinePlugin({ __VUE_PROD_DEVTOOLS__: 'false', }),
],

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4.x bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants