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

Should not use vue inner util, after upgrade everything doesn't worked #192

Closed
lijing666 opened this issue Aug 25, 2022 · 10 comments · Fixed by #193
Closed

Should not use vue inner util, after upgrade everything doesn't worked #192

lijing666 opened this issue Aug 25, 2022 · 10 comments · Fixed by #193

Comments

@lijing666
Copy link

latest version of vue-demi added var warn = Vue.util.warn cause all old webpack build doesn't worked

import Vue from 'vue'

var isVue2 = true
var isVue3 = false
var Vue2 = Vue
var warn = Vue.util.warn

this error is Vue.util is undefined

@zbjcool
Copy link

zbjcool commented Aug 25, 2022

image
It happened to me too

@lijing666
Copy link
Author

image It happened to me too

The problem is because old webpack var Vue = require('vue') is not Vue.default but Vue itself ,so Vue.util is undefined and Vue.default.util is defined

@antfu
Copy link
Member

antfu commented Aug 25, 2022

/cc @posva

@cyaque
Copy link

cyaque commented Aug 25, 2022

Same for me, crashed a release of a nuxt 2 project on my side.

@posva
Copy link
Collaborator

posva commented Aug 25, 2022

Does anybody has a boiled down repro? I don't see why Vue.util wouldn't work while Vue.config does

In https://github.com/posva/old-cli-vue-router it uses the esm version and it works fine

@cyaque
Copy link

cyaque commented Aug 25, 2022

It is not vue.util, it is vue.warn that crashes. Im in the middle of 4 releases, and patching this projects through, so I can't do much right now sorry.

@posva
Copy link
Collaborator

posva commented Aug 25, 2022

It's Vue.util.warn and fails at Vue.util. The screenshots suggest it should be Vue.default.util.warn but then everything also in this file also needs to be changed. I will take a look once it can be reproduced. I couldn't reproduce on a nuxt 2 project either: https://github.com/piniajs/example-nuxt-2

@cyaque
Copy link

cyaque commented Aug 25, 2022

Apologies, didn't check carefully. I've solved it by forcing a specific version (downgrade to 13.8).

I'm sharing my package json, hope it helps for the repro steps.
package.json.txt

@TouchSek
Copy link

Yes, the same issue on 0.13.9 or 0.13.10. after nuxt generate.

@TouchSek
Copy link

It's Vue.util.warn and fails at Vue.util. The screenshots suggest it should be Vue.default.util.warn but then everything also in this file also needs to be changed. I will take a look once it can be reproduced. I couldn't reproduce on a nuxt 2 project either: https://github.com/piniajs/example-nuxt-2

@posva you have build or generate the project, next you have to start the project in your local yarn start and you will see the error.

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

Successfully merging a pull request may close this issue.

6 participants