Author Archives: Robins

Vue3 vue.draggable slot jsx Error: Error: draggable element must have an item slot

The problems encountered when using vuedraggable to drag components in vue3 are recorded as follows:

1. There is no problem using the drag and drop plug-in in the template according to the official website, as follows:

Item is a named slot

<draggable v-model="myArray" item-key="id">
  <template #item="{element}">
    <div> {{element.name}} </div>
  </template>
</draggable>

2. When using drag plug-in in JSX, an error is reported: draggable element must have an item slot

Note that the item slot is written as follows:

    const slots = {
      item: ({element, index}) => {
          return <div> {{element.name}} </div>
      }
    }
    render(h) {
      return <draggable v-model="myArray" item-key="id" v-slots={ slots }></draggable>
    }

 

Connected Redis Execute command Error: (error) MISCONF Redis is configured to save RDB snapshots,

Error reporting when connecting to redis

(error) MISCONF Redis is configured to save RDB snapshots, but it is currently not able to persist on disk. Commands that may modify the data set are disabled, because this instance is configured to report errors during writes if RDB snapshotting fails (stop-writes-on-bgsave-error option). Please check the Redis logs for details about the RDB error.

The solution is as follows:

Connect redis and run the config set stop writes on bgsave error no command

Close the configuration item stop writes on bgsave error to solve the problem.

gradle –version Error: ERROR: JAVA_HOME is set to an invalid directory: /usr/local/opt/openjdk

1. Problems

appledeMacBook-Pro:~ apple$ gradle -version

ERROR: JAVA_HOME is set to an invalid directory: /usr/local/opt/openjdk

Please set the JAVA_HOME variable in your environment to match the
location of your Java installation.

2. Solution
vim /usr/local/bin/gradle

#!/bin/bash
#JAVA_HOME="${JAVA_HOME:-/usr/local/opt/openjdk/libexec/openjdk.jdk/Contents/Home}" exec "/usr/local/Cellar/gradle/7.0/libexec/bin/gradle"  "$@"
JAVA_HOME="${JAVA_HOME:-/Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home}" exec "/usr/local/Cellar/gradle/7.0/libexec/bin/gradle"  "$@"

[Solved] SQL Error (3621): String or binary data would be truncated The statement has been terminated.

I. Question

SQLServer database writing error occurred as follows: SQL Error (3621): String or binary data would be truncated The statement has been terminated. */

II. Cause

The length of the field definition in the database table structure is smaller than the actual length of the field content to be written, so it cannot be written.

III. Solution

After modifying the length of the fields in the table structure, it can be written successfully

eg:alter table table name alter column field name nvarchar(100)

[Solved] ERROR: ***-cp37-cp37m-linux_x86_64.whl is not a supported wheel on this platform.

pip install ***-cp37-cp37m-linux_x86_64.whl

ERROR:***-cp37-cp37m-linux_x86_64.whl is not a supported wheel on this platform.

 

Cause of error:

The mismatch between the downloaded installation package and the local Python version or system architecture causes.

For example, ***-cp37-cp37m-linux_x86_64.whl corresponds to python version 3.7, and the system version is x86_64 linux system.

ERROR StatusLogger No log4j2 configuration file found. Using default configuration: logging only errors to the console.

This error is because that log4j2.xml file not loaded

ERROR StatusLogger No log4j2 configuration file found. Using default configuration: logging only errors to the console.

View now

pom.xml have this code or not?

If it has, then add the follow code below:

<include>**/**.xml</include>

Just run it again.

[Solved] Vite2 Error: Unknown variable dynamic import

When the project is packaged and deployed with vite, it is found that some page resources cannot be obtained after deployment. The error is as follows:

Solution:

Replace

function getViews(path) {
  return () => import('../' + path + '.vue')
}

with

function getViews(path) {
  // First get all the addresses of the components you need to route dynamically
  let modules = import.meta.glob('. /*/*.vue')
  // Then fetch them like this when dynamically routing
  return modules['../' + path + '.vue']
}

The reason for the error is that there is an error in dynamic route acquisition.

[Solved] Centos7 Execute Script Error: syntax error near unexpected token `fi’

When the script written on the window computer is executed on Linux and always reports an error, as shown below

syntax error near unexpected token `fi'

Solution:

Open the file with vim and enter it in command line mode

:set ff

If it shows fileformat=dos
Now set our code mode with the command: set ff=unix
Execute: wq!
Check again to see that the code is programmed for unix


Via cat – V * * SH check that the code is normal.

In this way, there will be no errors when executing the code again.