Tag Archives: & View

When configuring the proxy with Vue, the front-end requests the server-side error 504; the Vue console reports the error occurred while trying to proxy request

Error occurred while trying to proxy request/login/from 127.0.0.1:8080 to http://127.0.0.1 :8081 (ECONNREFUSED) ( https://nodejs.org/api/errors.html#errors_ common_ system_ errors)

I searched for information on the Internet and found various answers. Then I tried several answers and found that there should be a problem with the port,

Finally, change the proxy address to http://127.0.0.1 9090 is the solution!

@Solution of error failed to get response from / Vue cli version marker

thank: CSDN@beeegood Questions provided.

Today, they encountered a very interesting bug. When they created a project with @ Vue/cli, they reported an error, which they had never seen before:

At first, I thought it was a version problem. After all, the error message said update, but the version of CLI was the latest. After asking, the node and NPM versions were also the latest (12.16.1, which was the latest as of the time I wrote this article). Most importantly, there was no old version of Vue cli

That’s very interesting. According to convention, when encountering the front-end problem, the first reaction is to unload and reload

npm uninstall -g @vue/cli
npm cache clean --force
npm install -g @vue/cli

However, it’s useless. After checking for a long time, we can’t find the relevant error report on the Internet, which is very embarrassing.

Later, I noticed that there is an output of yarn below. Is the built-in yarn in cli?But this shouldn’t be:

although I think it’s incredible, I still decided to look at the version of yarn. Yarn is highly suspected. Sure enough:

the problem was found. But what is this?Hadoop?

Later, I remembered that yarn is also a part of Hadoop, which is used to schedule resources:

Error code elifecycle errorno when NPM install command is executed in Vue project

Error code elifecycle errorno 1 when NPM install command is executed in Vue project

The complete error report is as follows

D:\workspace\dev\qorosauto-icv-ota-ui>npm install

> [email protected] install D:\workspace\dev\qorosauto-icv-ota-ui\node_m
odules\phantomjs-prebuilt
> node install.js

PhantomJS not found on PATH
Downloading https://github.com/Medium/phantomjs/releases/download/v2.1.1/phantom
js-2.1.1-windows.zip
Saving to C:\Users\xufeng.fu\AppData\Local\Temp\phantomjs\phantomjs-2.1.1-window
s.zip
Receiving...

Error making request.
Error: read ECONNRESET
    at TLSWrap.onStreamRead (internal/stream_base_commons.js:111:27)

Please report this full log at https://github.com/Medium/phantomjs
npm WARN [email protected] requires a peer of ajv@^5.0.0 but none is installed.
 You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\fse
vents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@
1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"}
)

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: `node install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional log
ging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\xufeng.fu\AppData\Roaming\npm-cache\_logs\2019-02-26T02_31
_14_943Z-debug.log

Read the error message. It is suspected that there is a problem when installing phantomjs. Try to execute the command NPM cache clear – force to clear the cache, manually download the phantomjs package and extract it to node_ Then execute the NPM install command again, and the execution is successful
note: CSDN can be downloaded for one point

Error: listen eaddnotavail: address not available

preface:

Build a distributed project, find a front-end project of Vue framework to do interface test, use nodejs to report error: listen eaddnotavail: address not available.

Problem analysis:

After the above error, there are still some error statements below. Here I show that IP and port number cannot be monitored.

Problem solving:

Modify the conf file under the Vue project, that is, under the configuration file, connect the IP and port of the background and the IP and port of the host. Configure IP to cost machine or IP address needed by the project, and solve the problem.

Vue error: error matching template:

The error information is as follows:

the above situation is generally caused by the following conditions:

{% verbatim%} {% endverbatim%} there are unclosed tags or redundant tags (such as div unclosed) in the range of tags bound by the UE instance el. After finding, delete or complete some tag statements cannot be bound by {{MSG}}, but by V-model. For example, input and textarea need to be bound with V-model,

Error: cannot find module ‘webpack / lib / ruleset’_ solve

1. Error report

Error: Cannot find module 'webpack/lib/RuleSet'

In the first question, I tried to put node_ Modules folder and package- lock.json Delete the file and then NPM install it. I don’t know if it’s useful or not. Let’s take a note to solve the problem https://segmentfault.com/q/1010000012177571/a-1020000012180629
Comments below

2. After the execution, an error is reported

Error: Rule can only have one resource source (provided resource and test +

Solutions:
1 https://blog.csdn.net/weixin_ 40643648/article/details/109444867
reload webpage

3. Error report after execution

These dependencies were not found:
@videojs/vhs-utils/dist/byte-helpers in ./node_modules/video.js/dist/video.es.js
@videojs/vhs-utils/dist/containers in ./node_modules/video.js/dist/video.es.js

Solution:
Baidu found that the error was lack of dependence, so it directly solved the problem

npm install 
yarn run server

Error failed to compile with 1 errors

The specific errors are as follows:

 

94% asset optimization

 ERROR  Failed to compile with 1 errors                                                                                     14:27:08

This dependency was not found:

* !!vue-style-loader!css-loader?{“sourceMap”:true}!../../../node_ modules/vue-loader/lib/style-compiler/index?{“vue”:true,”id”:”data-v-59d9138a”,”scoped”:false,”hasInlineConfig”:false}!stylus-loader?{“sourceMap”:true}!../../../node_ modules/vue-loader/lib/selector?type=styles&index=0!./ List.vue in ./src/pages/list/ List.vue

To install it, you can run: npm install –save !!vue-style-loader!css-loader?{“sourceMap”:true}!../../../node_ modules/vue-loader/lib/style-compiler/index?{“vue”:true,”id”:”data-v-59d9138a”,”scoped”:false,”hasInlineConfig”:false}!stylus-loader?{“sourceMap”:true}!../../../node_ modules/vue-loader/lib/selector?type=styles&index=0!./ List.vue

My mistake here is because I added a wrong specification in the process of creating a single file component:

Right

Storing JSON data in session storage

Storage data:

sessionStorage.setItem("loginInfo",JSON.stringify(bdata));

Get data

var loginObj=JSON.parse(sessionStorage.getItem('loginInfo'));

In web development, session storage is often used to store data, so it is not difficult to store a single string data variable

var str = 'This is a string';
sessionStorage.setItem('param',str);

Get sessionstorage

var item = sessionStorage.getItem('param');
console.log(item);

However, sessionstorage can only store string type data, and can’t directly store array types and JSON objects. If there is a need, what should I do?It’s very simple.

First, the JSON object is passed through JSON.stringify () method is converted to a string and stored in sessionstorage

var obj = {
  "name": "Tom",
  "age": 12,
  "gender": "man"
};
sessionStorage.setItem('jsonParams',JSON.stringify(obj));

And then through JSON.parse () method to convert the string to JSON format

var data = JSON.parse(sessionStorage.getItem('jsonParams'));
console.log(data);

[Error] because it violates the following Content Security Policy directive

[Error] because it violates the following Content Security Policy directive

In the process of HTML development, we encountered the following error, which means the permission problem of HTML meta setting

Refused to connect to 'blob:http://localhost:8080/6d57f07f-3c2f-49ca-be30-fd0b7f4cff6e' 
because it violates the following Content Security Policy directive: 
"default-src * 'self' 'unsafe-inline' 'unsafe-eval' data: gap: content: ". 
Note that 'connect-src' was not explicitly set, so 'default-src' is used as a fallback.

Specifically, this bug appears when using vue-html2pdf.
The screenshot is as follows

the last time I encountered a similar problem was when I used the video tag.
These are similar problems

You need to open the source code of the HTML page (for example, index.html ), modify the meta in the head section

  <meta http-equiv="Content-Security-Policy" content="default-src * 'self' 'unsafe-inline' 'unsafe-eval' data: gap: content: https://ssl.gstatic.com; 
    media-src * blob: 'self' http://* 'unsafe-inline' 'unsafe-eval'; 
    style-src * 'self' 'unsafe-inline'; 
    img-src * 'self' data: content:; 
    connect-src * blob:;">

The example is divided into multiple lines and can be modified according to your own needs. For example, IMG SRC allows * and other types of resources.
Connect SRC allows * blob: and other types of resources. Note that * does not contain the blob: type. If it is not declared, blob: may be wrong

reference material

Used to connect to XXX – because it violates the following content security policy
Cordova rejected to connect to xxxxx - white list refuses to send network requests
meta tag official website: https://developer.mozilla.org/zh-CN/docs/Web/HTML/Element/meta
Content security policy website: https://developer.mozilla.org/zh-CN/docs/Web/HTTP/Headers/Content-Security-Policy__ by_ cnvoid

Uncaught Error: THREE.OBJLoader : unexpected line: “DOCTYPE HTML” [solved]

Today’s problem really makes me despair. What you netizens say is that it’s OK to put it under static, but I can’t do it here 😥
Then I found that I had a static folder under public. After testing, I found that it was really static under public….
The code can still be written as usual

summary
obj file is put under public/static
questions
but why I don’t understand?If you know, please leave a message in the comment area 😁