Tag Archives: front end

[Solved] Error in v-on handler: “Error: please transfer a valid prop path to form item

Function Description:

Click “add” to add a line; Select a line and click Delete to delete it.

Question:

Click Delete to split only the model bound array to remove the array elements, and then click OK to validate the form and submit it normally; If you click Delete to split the array and directly call the function bound by the OK button to submit the form, the above error will be prompted during form verification and cannot be submitted normally. [Note: the code is not pasted completely, only the important part is pasted]

/*Delete*/     
delete(){
          this.form.params.splice(this.currentIndex, 1);
          this.currentIndex= this.form.params.length - 1;
          this.submitForm();
      }

/* Form Submission Method*/     
submitForm(){
      this.$refs["from"].validate((valid) => {
        if (valid) {
          update(this.from).then(response => {
            alert("Submit Successfully");
          });
        }
      })
}

reason:

In the delete method, the form is submitted after the splice. Because the change of the array has not been rendered, the submitted form is still before the splice, so an error is reported.

Solution:

Use promise().then() to put the call to the form submission in the then, so that it can be guaranteed to be submitted after rendering.

[Solved] npm link Error: error Error: EPERM: operation not permitted;The operation was rejected by your operating

Error message:

Solution:

From the error message, the prompt is that the permission is insufficient to operate. All the files found on the Internet are to delete npmrc files, but there is no effect. Through exploration, we can solve it in two ways:
1. Run vscode as an administrator, and then run NPM link on the vscode terminal
2. Run CMD (command prompt) as an administrator, Go into your own module and run NPM link

it’s done

[Solved] The main method caused an error: Could not deploy Yarn job cluster.

org.apache.flink.client.program.ProgramInvocationException: The main method caused an error: Could not deploy Yarn job cluster.

Caused by: org.apache.flink.client.deployment.ClusterDeploymentException: Could not deploy Yarn job cluster.

Caused by: org.apache.flink.yarn.YarnClusterDescriptor$YarnDeploymentException: The YARN application unexpectedly switched to state FAILED during deployment.

Diagnostics from YARN: Application application_1640140324841_0003 failed 1 times (global limit =4; local limit is =1) due to AM Container for appattempt_1640140324841_0003_000001 exited with  exitCode: 1
Failing this attempt.Diagnostics: [2021-12-22 11:23:34.422]Exception from container-launch.
Container id: container_e44_1640140324841_0003_01_000001
Exit code: 1
Shell output: main : command provided 1
main : run as user is etl_admin
main : requested yarn user is etl_admin
Getting exit code file…
Creating script paths…
Writing pid file…
Writing to tmp file /data1/yarn/nm/nmPrivate/application_1640140324841_0003/container_e44_1640140324841_0003_01_000001/container_e44_1640140324841_0003_01_000001.pid.tmp
Writing to cgroup task files…
Creating local dirs…
Launching container…

 

Solution:
Look is the flink version of the idea is 1.11.0, the flink version on the cluster is 1.13.1
Directly upgrade the flink version in the idea to 1.13.1, done!

IE8 browser Webloader will always go uploaderror and report error: http

When using Baidu webloader, the IE8 browser will always use the uploaderror when debugging

uploader.on( 'uploadError', function( file,reason ) {
     alert(reason) ;
});

The reason error is http. The reason is:
the reason why JSON is returned when it is returned in the background.

The backend of webuploader cannot return json, convert json to string type, take com.alibaba.fastjson.JSONObject as an example,
com.alibaba.fastjson.JSONObject.toJSONString([json or object data]);

[Solved] Error: EBUSY: resource busy or locked, lstat ‘D:\DumpStack.log.

Error: EBUSY: resource busy or locked, lstat ‘D:\DumpStack.log

If there is a SaaS like field in your vscade error report, one reason is that the version number does not match.

cnpm i -D [email protected] --save
cnpm i -D [email protected] --save

I won’t let go of the screenshot that reported an error. At that time, the error mentality collapsed. I may have forgotten the screenshot. I don’t want to make a similar error in the whole. I’m tired. (later found)

In a word, it is much faster to correct the version number first and then change it. The errors caused by other problems will be much faster.

I found the wrong screenshot of the * *

After the two commands are run, the following error reports are much kinder. It’s just that there is no dependency. The problem is not big. Just install it.


Done!

[Solved] Element form method Error: TypeError: Cannot read properties of undefined (reading ‘resetFields’)

use:

      /**
       * rebuild sheet
       */
      resetForm(formName){
          this.$refs[formName].resetFields();
      },

report errors:

TypeError: Cannot read properties of undefined (reading 'resetFields')
    at VueComponent.resetForm (index.vue?6ced:501)
    at VueComponent.addColumn (index.vue?6ced:487)
    at click (index.vue?5d22:653)
    at invokeWithErrorHandling (vue.runtime.esm.js?2b0e:1854)
    at VueComponent.invoker (vue.runtime.esm.js?2b0e:2179)
    at invokeWithErrorHandling (vue.runtime.esm.js?2b0e:1854)
    at VueComponent.Vue.$emit (vue.runtime.esm.js?2b0e:3888)
    at VueComponent.handleClick (element-ui.common.js?5c96:9441)
    at invokeWithErrorHandling (vue.runtime.esm.js?2b0e:1854)
    at HTMLButtonElement.invoker (vue.runtime.esm.js?2b0e:2179)

Solution:

      /**
       * rebuild sheet
       */
      resetForm(formName) {
        //The purpose of adding if judgment condition is to solve the problem that the console prompt object does not exist
        if (this.$refs[formName] !== undefined) {
          this.$refs[formName].resetFields();
        }
      },

[Solved] electron Use remote Error: Cannot read properties of undefined (reading ‘BrowserWindow‘)

Recently, I wrote a small demo of remote while learning electron. There is such a code:

const BrowserWindow = require("electron").remote.BrowserWindow;

An error will be reported, as shown in the following figure:

Then I went to the Internet and looked at some articles. It seems to be a problem with the version. My electron is @V16.0.4, and remote abandoned the remote module in electron12, so we need to install the remote package ourselves.

1. First install the @electron/remote package under the project root directory:

npm install @electron/remote --save

2. Initialize in the main process:

require("@electron/remote/main").initialize();
require("@electron/remote/main").enable(mainWindow.webContents);

3. And set enableremotemodule and contextisolation in the main process webpreferences:

 webPreferences: {
    nodeIntegration: true,
    contextIsolation: false,
    enableRemoteModule: true, // use remote module
 },

4. Set in the rendering process

const BrowserWindow = require("@electron/remote").BrowserWindow;

Well, this is my overall Code:

Main process

var electron = require("electron");
var app = electron.app; // Reference app
var BrowserWindow = electron.
var mainWindow = null; // Specify the main window to open

// When electron has finished initializing and is ready to create a browser window
// This method is called
app.on("ready", () => {
  mainWindow = new BrowserWindow({
    width: 800,
    height: 800,
    webPreferences: {
      nodeIntegration: true,
      contextIsolation: false,
      enableRemoteModule: true, // use remote module
    },
  });

  require("@electron/remote/main").initialize(); // initialize
  require("@electron/remote/main").enable(mainWindow.webContents);
  mainWindow.loadFile("demo2.html"); // load the index.html page
  mainWindow.openDevTools(); // open developer tools

  mainWindow.on("closed", () => {
    mainWindow = null;
  });
});

Subprocess

const btn = this.document.querySelector("#btn");
const BrowserWindow = require("@electron/remote").BrowserWindow;

window.onload = () => {
  btn.onclick = () => {
    newWin = new BrowserWindow({
      width: 500,
      height: 500,
    });

    newWin.loadFile("load.html");
    newWin.on("closed", () => {
      newWin = null;
    });
  };
};

Result display

[Solved] Browser Access Error: Request Header or Cookie too large

Browser access page error

Error details

Possible causes:

The request header is too large, which is usually caused by writing a large value in the cookie. Access too frequently, the browser cache is too large, resulting in errors.

Solution:

The client can clean up the cookie cache
the server adjusts the size of nginx buffer and adds two lines

http
{
client_header_buffer_size 32k;
large_client_header_buffers 4 32k;  
......
}

Restart service

[Solved] NPM install error: Maximum call stack size exceeded

1. Scene reproduction

Today, I wanted to pull someone else’s code to have a look, and then NPM install reported this error: “maximum call stack size exceeded”. I haven’t seen this error before, and finally found a solution.

2. Solution

1. Upgrade NPM, NPM install – G NPM
2 Re execute, NPM/cnpm install
3 If not, try clearing the NPM cache. NPM cache clean — force
4 Re execute, NPM/cnpm install

[Solved] Vue3 Error: Cant find variable: GlobalThis

After the project is packaged, use a browser with a lower version to open it and report an error

Solution
Vue config.js

import { defineConfig } from 'vite';
import vue from '@vitejs/plugin-vue';
import legacy from '@vitejs/plugin-legacy';

// https://vitejs.dev/config/
export default defineConfig({
  base: './',
  plugins: [
    vue(),
    legacy({
      targets: ['> 1%, last 1 version, ie >= 11'],
      additionalLegacyPolyfills: ['regenerator-runtime/runtime'],
    }),
  ],
});