Tag Archives: View.js

[Vue warn]: Error in v-on handler: “TypeError: Object(…) is not a function“

The record appears in Vue
[Vue warn]: error in v-on handler: "typeerror: object (...) is not a function"

when referencing an external file, it is only partially referenced, so it was originally referenced in a deconstruction mode. I forgot to add
{}

// Wrong
import loginAPI from '@/api'

// Right
import { loginAPI } from '@/api'

Error command failed when creating vue-cli4 project: Yarn

Error reported when creating Vue item: error command failed: Yarn

Solution 1: Win + R enter CMD to enter the command line interface

Enter command

npm install -g yarn

After success, the problem can be solved by re creating vue-cli4 project.

Solution 2:

Enter C:/users/administrator/in the windows environment

There is a file. Vuerc

 

Open this file to display

{
  "useTaobaoRegistry": true,
  "packageManager": "yarn"
}

Just manually change the configuration content yarn to NPM to change the package manager when the project is created

Solution 3:

Delete the. Vuerc file. When you create a Vue project for the first time, you will be prompted to select the configuration, and then select NPM
 

error: RPC failed; curl 92 HTTP/2 stream 0 was not closed cleanly: CANCEL (err 8)

When uploading code to GitHub using git, the following error occurs:

It is true that there is a large amount of code uploaded at one time, and then expand the post buffer according to the scheme provided on the Internet, but it has no effect here. Maybe the buffer is not large enough, HHH. You can try this plan first.

git config http.postBuffer 524288000

Then, if it has not been solved, try the following scheme. We can see that the error message refers to http/2, so the solution is to switch back to http1 upload. After uploading, switch back to http2.

$ git config --global http.version HTTP/1.1
After it push was ok and I have changed HTTP version to 2 again:
$ git config --global http.version HTTP/2

However, things were always so bad, so I tried to switch to SSH connection.

git remote set-url origin [email protected]:{username}/{repository name}.git

However

Looking at this line of red and yellow characters, I knew early in the morning that the file was too large, but the above methods didn’t work here. Fortunately, GIT LFS was mentioned in the error prompt. OK, Download git LFS.

For Mac users:

brew install git-lfs

  Then, under the project directory, execute:

git lfs install

Then, use git LFS to track the format of the large file you want to upload. What I upload here is in Bin format, so execute:

git lfs track "*.bin"

Then make sure  . Gitattributes tracked to

git add .gitattributes

Then upload it

Module build failed: Error: Node Sass does not yet support your current environment: Windows 64-bit

@[TOC](Module build failed: Error: Node Sass does not yet support your current environment: Windows 64-bit with Unsupported runtime (93))

Importing other people’s Vue projects on gitee or GitHub can easily lead to incompatible node sass versions. Generally, you are prompted as follows:

Module build failed: Error: Node Sass does not yet support your current environment: Windows 64-bit with Unsupported runtime (93)
For more information on which environments are supported please see:
https://github.com/sass/node-sass/releases/tag/v4.12.0

This is the error encountered

We open the web page on the link and find that it is the corresponding version. My node version is 16, which is incompatible

Here, you need to change the version of node sass in package.json to match the notejs Version (emphasis)

On the official website, you can see that my nodejs (16) corresponds to 6.0+

After modification, it is better to delete the previous node sass Version (under the node_medules directory)

Re execute NPM I or cnpm I to re import dependencies

Done!!!

[Solved] ERROR Error: Cannot find module ‘vue-loader-v16/package.json‘

Error Message:
ERROR  Error: Cannot find module ‘vue-loader-v16/package.json’
Error: Cannot find module ‘vue-loader-v16/package.json’
at Function.Module._resolveFilename (module.js:555:15)
at Function.Module._load (module.js:482:25)
at Module.require (module.js:604:17)
at require (internal/module.js:11:18)
at api.chainWebpack.webpackConfig (D:\3\data\dashboard\node_modules\_@[email protected]@@vue\cli-service\lib\config\base.js:114:23)
at webpackChainFns.forEach.fn (D:\3\data\dashboard\node_modules\_@[email protected]@@vue\cli-service\lib\Service.js:236:40)
at Array.forEach (<anonymous>)
at Service.resolveChainableWebpackConfig (D:\3\data\dashboard\node_modules\_@[email protected]@@vue\cli-service\lib\Service.js:236:26)
at Service.resolveWebpackConfig (D:\3\data\dashboard\node_modules\_@[email protected]@@vue\cli-service\lib\Service.js:240:48)
at PluginAPI.resolveWebpackConfig (D:\3\data\dashboard\node_modules\_@[email protected]@@vue\cli-service\lib\PluginAPI.js:132:25)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] serve: `vue-cli-service serve`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] serve script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\lenovo\AppData\Roaming\npm-cache\_logs\2021-09-22T07_50_43_187Z-debug.log
Solution: Execute the following commands:
cnpm i vue-loader-v16

Module build failed: Error: Node Sass version 6.0.0 is incompatible with ^4.0.0

When executing the named NPM run dev to start the front-end project, the following error is reported

Module build failed: Error: Node Sass version 6.0.0 is incompatible with ^4.0.0.

From the prompt, I downloaded the latest dependency. The current version is incompatible. Later, I checked the relevant documents, which is really caused by the high version;

The simple way is to find the appropriate version and install the specified version (try it several times if you don’t know the version)

The processing steps are as follows:

#uninstall
npm uninstall node-sass

#install with the version
npm install [email protected] --save-dev

Run NPM run dev again

Error: [VueLoaderPlugin Error] No matching use for vue-loader is found. Make sure the rule matching

Project scenario:

using webpck5 package vue3 plug-in to import Vue loader appears

Error: [VueLoaderPlugin Error] No matching use for vue-loader is found. 
Make sure the rule matching .vue files include vue-loader in its use.

terms of settlement:

It can be solved by putting Vue loader in the first place

  module: {
    rules: [
      {
        test: /\.vue$/,
        loader: "vue-loader",
      },

The Vue project is packaged and deployed to tomcat, and an Error 404 is reported as soon as it is refreshed

The reason is that the history mode is used   HTML5 history mode | Vue router

I didn’t find a solution

So we changed the routing to hash mode

I use cli3

It was

import {createRouter, createWebHistory} from 'vue-router'

const router = createRouter({
    history: createWebHistory(process.env.BASE_URL),
    routes
})

Change to

import {createRouter, createWebHashHistory} from 'vue-router'

const router = createRouter({
  model:'hash',
  history: createWebHashHistory(),
  routes
})

It’s normal after modification