Tag Archives: front end

Error: timeout of 5000ms exceeded error is always reported during post request

The error: timeout of 5000ms exceeded error is always reported in the post request, but there is no problem with the get request. The front-end uses the Vue element admin framework.

terms of settlement:

//Use before for mock data and after for back-end interface. Otherwise, it will request a failure message with a timeout of 5000ms or delete it directly

 

ERROR Error: Cannot find module ‘../../uni-cli-sharedlib/tags‘

ERROR    Error:   Cannot   find   module  ‘../../ uni-cli-sharedlib/tags’

Recently, I ran the SVN project and reported an error. I tried many methods and various commands on the Internet

The last one found is that the NPM and node versions are incompatible

My node is 16.13.0

NPM is 8.13.1

The two versions are incompatible

The NPM version corresponding to node16.13.0 is 8.1.0

It can be solved by matching the version with this figure  

How to Solve Error: spawn xxxx ENOENT

Error explanation:   This error indicates that no such directory exists, which generally means that the global variable of command XXX is not set
The full name of enoent is error no entry, and there is no error in the entity directory;

Example: scaffold occurs when NPM installation directory is used, and spawn git enoent error occurs

Solution: it means that Git is not installed or the GIT environment variable is not set. Add “C:\program files\git\bin” in the path of the environment variable. The path is adjusted according to your git installation directory

[Solved] error C:\Users\HP\Desktop\VueProject\vue_cli\node_modules\node-sass: Command failed.Exit code: 1

Vue-cli scaffolding to build a Vue project reports an error due to the installation of node-sass:

error C:\Users\HP\Desktop\VueProject\vue_cli\node_modules\node-sass: Command failed.
Exit code: 1
Command: node scripts/build.js
Arguments:
Directory: C:\Users\HP\Desktop\VueProject\vue_cli\node_modules\node-sass
Output:
Building: C:\Program Files\nodejs\node.exe C:\Users\HP\Desktop\VueProject\vue_cli\node_modules\node-gyp\bin\node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
gyp info it worked if it ends with ok
gyp verb cli [
gyp verb cli   'C:\\Program Files\\nodejs\\node.exe',
gyp verb cli   'C:\\Users\\HP\\Desktop\\VueProject\\vue_cli\\node_modules\\node-gyp\\bin\\node-gyp.js',
gyp verb cli   'rebuild',
gyp verb cli   '--verbose',
gyp verb cli   '--libsass_ext=',
gyp verb cli   '--libsass_cflags=',
gyp verb cli   '--libsass_ldflags=',
gyp verb cli   '--libsass_library='
gyp verb cli ]
gyp info using [email protected]
gyp info using [email protected] | win32 | x64
gyp verb command rebuild []
gyp verb command clean []
gyp verb clean removing "build" directory
gyp verb command configure []
gyp verb download using dist-url https://oss.npmmirror.com/dist/node
gyp verb check python checking for Python executable "python2" in the PATH
gyp verb `which` failed Error: not found: python2
gyp verb `which` failed     at getNotFoundError (C:\Users\HP\Desktop\VueProject\vue_cli\node_modules\which\which.js:13:12)
gyp verb `which` failed     at F (C:\Users\HP\Desktop\VueProject\vue_cli\node_modules\which\which.js:68:19)
gyp verb `which` failed     at E (C:\Users\HP\Desktop\VueProject\vue_cli\node_modules\which\which.js:80:29)
gyp verb `which` failed     at C:\Users\HP\Desktop\VueProject\vue_cli\node_modules\which\which.js:89:16
gyp verb `which` failed     at C:\Users\HP\Desktop\VueProject\vue_cli\node_modules\isexe\index.js:42:5
gyp verb `which` failed     at C:\Users\HP\Desktop\VueProject\vue_cli\node_modules\isexe\windows.js:36:5
gyp verb `which` failed     at FSReqCallback.oncomplete (node:fs:198:21)
gyp verb `which` failed  python2 Error: not found: python2
gyp verb `which` failed     at getNotFoundError (C:\Users\HP\Desktop\VueProject\vue_cli\node_modules\which\which.js:13:12)
gyp verb `which` failed     at F (C:\Users\HP\Desktop\VueProject\vue_cli\node_modules\which\which.js:68:19)
gyp verb `which` failed     at E (C:\Users\HP\Desktop\VueProject\vue_cli\node_modules\which\which.js:80:29)
gyp verb `which` failed     at C:\Users\HP\Desktop\VueProject\vue_cli\node_modules\which\which.js:89:16
gyp verb `which` failed     at C:\Users\HP\Desktop\VueProject\vue_cli\node_modules\isexe\index.js:42:5
gyp verb `which` failed     at C:\Users\HP\Desktop\VueProject\vue_cli\node_modules\isexe\windows.js:36:5
gyp verb `which` failed     at FSReqCallback.oncomplete (node:fs:198:21) {
gyp verb `which` failed   code: 'ENOENT'
gyp verb `which` failed }
gyp verb check python checking for Python executable "python" in the PATH
gyp verb `which` succeeded python C:\Users\HP\anaconda3\python.EXE
gyp ERR! configure error
gyp ERR! stack Error: Command failed: C:\Users\HP\anaconda3\python.EXE -c import sys; print "%s.%s.%s" % sys.version_info[:3];
gyp ERR! stack   File "<string>", line 1
gyp ERR! stack     import sys; print "%s.%s.%s" % sys.version_info[:3];
gyp ERR! stack                                ^
gyp ERR! stack SyntaxError: invalid syntax
gyp ERR! stack
gyp ERR! stack     at ChildProcess.exithandler (node:child_process:397:12)
gyp ERR! stack     at ChildProcess.emit (node:events:390:28)
gyp ERR! stack     at maybeClose (node:internal/child_process:1064:16)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:301:5)
gyp ERR! System Windows_NT 10.0.19043
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\HP\\Desktop\\VueProject\\vue_cli\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd C:\Users\HP\Desktop\VueProject\vue_cli\node_modules\node-sass
gyp ERR! node -v v16.13.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
Build failed with error code: 1
 ERROR  command failed: yarn

 

wrong reason:
The nodejs version is too high, my version is 16.x

Solution:
win+R open the cmd window and enter

node -v

Check the installed node version. If it is not v14.3.0, uninstall the original version and reinstall nodejs of v14.3.0.

Create the project again and solve it successfully!

Nodejs download address of v14.3.0 is attached:

Vue3. X reports an error using vantui. Failed to resolve component: Van-**-**

Version number:

vue/cli:4.5.12

vant:^3.0.10

Question:

Failed to resolve component: van-cell-group 
  at <Home onVnodeUnmounted=fn<onVnodeUnmounted> ref=Ref< undefined > key=0 >

Reason: the van cell group component is not imported

Solution:

You can import it in the ‘main. JS’ file and then use it on the page

The details are as follows:

import {
	createApp
} from 'vue'
import {
	CellGroup
} from 'vant'
createApp(App).use(CellGroup)

Failed to load plugin jsdoc: Cannot find module ‘eslint-plugin-jsdoc‘

In the egg project, NPM is installed for the first time   The following errors are reported when the package is:

Oops! Something went wrong! :(

ESLint: 5.16.0.
ESLint couldn't find the plugin "eslint-plugin-jsdoc". This can happen for a couple different reasons:

1. If ESLint is installed globally, then make sure eslint-plugin-jsdoc is also installed globally. A globally-installed ESLint cannot find a locally-installed plugin.

2. If ESLint is installed locally, then it's likely that the plugin isn't installed correctly. Try reinstalling by running the following:

     npm i eslint-plugin-jsdoc@latest --save-dev

Path to ESLint package: /Users/***/node_modules/eslint

If you still can't figure out the problem, please stop by https://gitter.im/eslint/eslint to chat with the team.

The eslint does not work normally, and when the file does not comply with the eslint rules, an error is reported in the console log as follows:

Failed to load plugin jsdoc: Cannot find module 'eslint-plugin-jsdoc'....

reason:

When NPM v8.0 installed the project dependency, it did not correctly install the project dependency (eslint config egg) dependency (eslint plugin JSDoc)

solve:

After upgrading NPM to v8.1.2, delete the node in the project_ Modules and package-lock.json, and then reinstall

rm -rf node_modules
rm package-lock.json
npm i

Supplement:

If you have the same error, you can search globally   Eslint plugin JSDoc to locate dependencies with NPM command

➜  *** git:(master) ✗ npm ls eslint-plugin-jsdoc
***@1.0.0 /Users/***
└─┬ [email protected]
  └── [email protected]

Then determine whether to install or upgrade NPM manually or for other reasons.

Chunkloaderror caused by deleteoriginalassets: loading chunk * failed error

If you don’t say much, report the error directly:

this error report looks too familiar. After searching online, the general solution is:

1. Record an error in Vue history mode chunkloaderror: loading chunk XX failed net:: err_ Abort 404 (not found) solution

2. Error: loading chunk * failed, Vue router lazy loading error report solution

Follow the example. History, publicpath, onerror, and even the online server. Whatever solution you have, I can’t solve it. There’s no sign that it can be solved. I’m still a local project, and removing lazy loading can’t solve this problem. Why are such errors prompted?

In the end, experienced colleagues have to find the cause of the problem: delete original assets. Finally, just comment it out.

In vue.config.js, it is used to optimize the front-end performance: front-end performance optimization – using gzip compression.

Front end Vue project operation error module build failed

Scenario Description: when a Vue project of someone else is running on vscode, the download dependency process is normal, and the run dev reports an error. The information is as follows
in many cases, this error is because the node version required for project operation is inconsistent with your local node version. Just switch back to the normal version

Failed to resolve async component default: ChunkLoadError: Loading chunk 7 failed

Vue project, it says that vue-router.esm.js suddenly reports an error? 8c4f: 16 [Vue router] failed to resolve async component default: chunkloaderror: loading chunk 7 failed. I really can’t find anything wrong,

through the prompt, it’s said that there was a routing error. I reinstalled less according to what I wrote on the Internet, but it didn’t work. Later, I inadvertently changed the name of the lazy load of the route a little, What’s going on? I still haven’t found it. If you have the same problem, you can try to change the wrong route name. In the following figure/*specialvideo*/change the name and store it. The error disappears. I don’t know why

How to Solve Error: failed to load response

reason:

Because the back-end does not write cross-domain-related information to the header, the front-end cannot load data.

analysis:

1. First, check whether there are cross-domain-related configurations in the project, and then find out whether there are configurations.

2. This should be added only when the controller is executed.

3. Because our project has built an interceptor to intercept the token parsing into user-related information, because if there is no token expiration, the interceptor will throw an exception. When returning, cross-domain-related things will not be added. So the front end cannot be loaded.

Solution:

Add response and related cross domain information to the interceptor

In addition, you need to know the execution sequence of interceptors and filters

* ** ->  Filter -> Interceptor -> ControllerAdvice -> Aspect -> Controller