question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

NPM7: Incorrect detection of Vue version

See original GitHub issue

Hi, I was trying to use @vueuse/core when I ran into an issue with this package. I’m using npm 7.0.3, node 15.0.1 and my package.json looks like this:

{
    "private": true,
    "scripts": {
        "development": "mix",
        "watch": "mix watch",
        "watch-poll": "mix watch -- --watch-options-poll=1000",
        "hot": "mix watch --hot",
        "production": "mix --production"
    },
    "devDependencies": {
        "@vue/compiler-sfc": "^3.0.2",
        "autoprefixer": "^10.0.1",
        "axios": "^0.19",
        "cross-env": "^7.0",
        "laravel-mix": "^6.0.0-beta.11",
        "lodash": "^4.17.19",
        "postcss-import": "^12.0.1",
        "postcss-nested": "^4.2.3",
        "postcss-simple-vars": "^5.0.2",
        "resolve-url-loader": "^3.1.0",
        "sass-resources-loader": "^2.1.1",
        "tailwindcss": "^1.9.6",
        "tailwindcss-filters": "^3.0.0",
        "vue": "^3.0.2",
        "vue-loader": "^16.0.0-beta.10",
        "vue-router": "^4.0.0-rc.1",
        "vuex": "^4.0.0-rc.1",
        "@vueuse/core": "^4.0.0-beta.38"
    }
}

I’m using Laravel Mix to compile all the assets (I’ll be using Laravel as a backend). Everything was going fine until I tried to use any function from the vueuse package.

The console error looked like this:

image

Going thru the module code I see some lines are overwritten depending of the Vue version and it looks like the module thinks I’m on version 2 of Vue. Manually changing those lines to the ‘v3’ fixed the issue. I’m not sure this is Laravel Mix fault (webpack wrapper) or not. Let me know how can I help fixing this issue.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:12 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
gerardnllcommented, Nov 9, 2020

Yes. Looks like it’s working on my main project (where I do the compiling). Great!

1reaction
antfucommented, Nov 9, 2020

@gerardnll I see. I have heard that npm 7 will install the peerDepenencies automatically. I will have a look at this to see if we can come up with a solution. Thanks.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How do I fix a "Vue packages version mismatch" error on Vue ...
It's important that you check that the packages you're using are compatible with their version. Reinstalling the packages will not fix anything ...
Read more >
npm 7 is now generally available! - The GitHub Blog
We're announcing version 7 of the npm CLI is now generally available.
Read more >
@vue/cli | Yarn - Package Manager
Command line interface for rapid Vue.js development. vue, cli. readme. @vue/cli. npm install -g @vue/cli vue create my-project.
Read more >
Heroku Node.js Support
This document describes the general behavior of Heroku as it relates to the recognition and execution of Node.js applications.
Read more >
Unable to resolve dependency tree error in Angular while ...
It's a dependency conflict (incorrect and potentially broken ... to resolve this error set --legacy-peer-deps flag to true in npm 7 version.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found