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

ReferenceError: __VUE_PROD_DEVTOOLS__ is not defined #1250

Open
gimler opened this issue Jan 11, 2024 · 3 comments
Open

ReferenceError: __VUE_PROD_DEVTOOLS__ is not defined #1250

gimler opened this issue Jan 11, 2024 · 3 comments

Comments

@gimler
Copy link
Contributor

gimler commented Jan 11, 2024

i get an error when i build for production Uncaught ReferenceError: __VUE_PROD_DEVTOOLS__ is not defined

my workaround:

const DefinePlugin = require('webpack/lib/DefinePlugin')

Encore
...
.addPlugin(
    new DefinePlugin({
      __VUE_PROD_DEVTOOLS__: JSON.stringify(false)
    })
  )
@mbabker
Copy link

mbabker commented Jan 16, 2024

Encore has a shortcut API for configuring the DefinePlugin:

Encore
    .configureDefinePlugin(options => {
        options.__VUE_OPTIONS_API__ = true;
        options.__VUE_PROD_DEVTOOLS__ = false;
        options.__VUE_PROD_HYDRATION_MISMATCH_DETAILS__ = false;
    })

As for the actual reported error, the Vue team came across to me as pretty dismissive in vuejs/core#10039 when a similar type of issue was raised. Unless someone PR's something to automatically add those flags within the context of Encore, the "workaround" seems to be the right fix since the documentation on https://vuejs.org/api/compile-time-flags is no longer accurate (specifically, "Vue will work even if these flags are not explicitly configured").

@Maks180188
Copy link

@mbabker thanks I couldn't find how to specify it in Encore for half a day. Please write a link to the documentation where you found it

@carsonbot
Copy link

Thank you for this issue.
There has not been a lot of activity here for a while. Has this been resolved?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants