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
initDev() Not being called in the browser #5785
Labels
Comments
d-pollard
changed the title
initDev() Not being called in the browser
Aug 12, 2020
initDev()
Not being called in the browser
@sodatea - would love to contribute a PR for this; as it stands a fix as I see it would be something like this: User based approachvue.config.jsmodule.exports = {
runtimeCompiler: process.env.NODE_ENV === 'development'
}; CLI source fixThe alternative would be to check the environment we're running in here: https://github.com/vuejs/vue-cli/blob/dev/packages/%40vue/cli-service/lib/config/base.js#L118 webpackConfig.resolve
.alias
.set(
'vue$',
options.runtimeCompiler || process.env.NODE_ENV === 'development'
? 'vue/dist/vue.esm-bundler.js'
: '@vue/runtime-dom'
) Please advise which approach you'd prefer; alternatively, suggest a fix and I'll implement it |
sodatea
added a commit
to sodatea/vue-cli
that referenced
this issue
Aug 14, 2020
The old alias `@vue/runtime-dom` was introduced because webpack HMR has trouble with pure re-exports. Now that the `vue.runtime.esm-bundler.js` file also includes a call to `initDev`, it's no longer an issue. This also enables Dev Tool in Vue 3 runtime. Fixes vuejs#5785
9 tasks
@d-pollard See #5788 |
sodatea
added a commit
that referenced
this issue
Aug 14, 2020
The old alias `@vue/runtime-dom` was introduced because webpack HMR has trouble with pure re-exports. Now that the `vue.runtime.esm-bundler.js` file also includes a call to `initDev`, it's no longer an issue. This also enables Dev Tool in Vue 3 runtime. Fixes #5785
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Version
3.0.0-rc.5
Reproduction link
https://github.com/d-pollard/testing-vue3
Steps to reproduce
Vue CLI generate a new app;
npm run serve
open dev tools; see that
window.__VUE__
isn't setWhat is expected?
initDev() should run (setting
__VUE__
and runningsetDevtoolsHook
with__VUE_DEVTOOLS_GLOBAL_HOOK__
)What is actually happening?
These fields aren't being set;
initDev
is being called when we build insteadI can add
import 'vue/dist/vue.esm-bundler';
in main.js and it'll set properlyThe text was updated successfully, but these errors were encountered: