Author Archives: Robins

[Solved] Vue Syntax Error: Error: PostCSS plugin postcss-pxtorem requires PostCSS 8. -rem Layout

vue Syntax Error: Error: PostCSS plugin postcss-pxtorem requires PostCSS 8.
migration guide for end users:
for the scaffold generation project, configure the adaptive postcss pxtorem configuration and report an error

First of all, you are postcssrc. JS file normal configuration (detailed configuration)

module.exports = {
  plugins: {
    autoprefixer: {
      overrideBrowserslist: [
        "Android 4.1",
        "iOS 7.1",
        "Chrome > 31",
        "ff > 31",
        "ie >= 8",
        "last 10 versions",
      ],
      grid: true,
    },
    "postcss-pxtorem": {
      rootValue: 37.5, //The result is: design element size / 16, for example, element width 320px, the final page will be converted to 20rem
      propList: ["*"], // is a list of properties that will be converted, here set to ['*'] all, suppose you need to set only the border, you can write ['*', '!border*']
      unitPrecision: 5, //how many decimal places to keep rem
      //selectorBlackList: ['.radius'], //then it is an array for filtering css selectors, for example you set it to ['fs'], that for example fs-xl class name, inside the style about px will not be converted, here also support regular writing.
      replace: true, //I really don't know what this is for. If you know, let me know!
      mediaQuery: false, //media query (@media screen or something like that) does not work
      minPixelValue: 12, //px less than 12 will not be converted
    },
  },
};

You can also do this (a little simpler)

module.exports = {
  plugins: {
    'autoprefixer': {
      browsers: ['Android >= 4.0', 'iOS >= 8']
    },
    'postcss-pxtorem': {
      rootValue: 37.5,
      propList: ['*']
    }
  }
}

At this time, if the project is configured normally, there will be an error in running the project

It is said that your postcss can not identify the postcss-pxtorem , so the error is caused, this time you can not configure the postcssrc.js, only the comment configuration will work properly, this time you can package.json to look at your dependencies

At this time you will find that your postcss-pxtorem is 6.xxx version, because it is his version is too high, so the problem is caused

You just need to lower the version to 5.1.1 on OK

npm i [email protected]

Then you run it again to solve the problem

Tomcat Start Error: Internal error (java.lang.IllegalStateException): Duplicate key org.jetbrains.jps.model.module.impl.JpsModuleImpl@548a102f

1. The error message is shown in the figure below:

2. Solution: find .idea in the project and delete misc.xml file.

 

PS: why generated misc.xml file:

(1) Possible causes (take me as an example): I shut down my computer when running a web project, resulting in abnormal idea editor. All Tomcat related configurations in idea are missing.

Solution: reinstall idea

Reinstall idea details: when uninstalling tips: do not delete those history records and configurations

 


I. Tomcat startup error: internal error (Java. Lang. IllegalStateException): duplicate key (internal error (Java. Lang. IllegalStateException): duplicate key):
— find the .idea delete misc.xml file


II. Tomcat related configurations in idea are missing:
reinstall idea (when uninstalling tips: do not delete those history records and configurations)

xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun

macbook pro m1 pro run git error:

xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun

Follow the prompts to install xcrun

Enter at the command line

xcode-select --install

Select Install. You can also directly install Xcode and then make relevant settings.

Spring Boot Startup Error: Error starting ApplicationContext. To display the conditions report re-run your app

2021-12-27 10:02:47.548 ERROR 5376 — [           main] o.s.b.d.LoggingFailureAnalysisReporter   :

If you have not connected to the database at the beginning of the configuration, comment out the database dependency and refresh it.

Project startup: After commenting out mybatis and re-updating the configuration, you will be able to see the content to be returned

[Solved] tf.summary Error: tags and values not the same shape

Recently, TF. In tensorflow has been used The summary module is debugged to print the shape and value of the tensor you want to see when the main program runs

Although tensorflow version 1.15.5 is used, even tf.enable_eager_execution() also cannot see the length of the actual dimensions of the tensor.

TF Code of summary section:

edges_0_shape = tf.Print(tf.shape(edges_0), [tf.shape(edges_0)])

tf.summary.scalar('shape_edges_0', edges_0_shape)

Error message:

tensorflow.python.framework.errors_impl.InvalidArgumentError: tags and values not the same shape: [] != [2]

Explanation: edges_0 is a tensor and a two-dimensional tensor, so TF The return value of shape (edges_0) is a one-dimensional tensor such as [100, 50], so TF.summary.tensor_Summary () should be used, not TF.summary. scalar()

After modification:

edges_0_shape = tf.Print(tf.shape(edges_0), [tf.shape(edges_0)])
tf.summary.tensor_summary('shape_edges_0', edges_0_shape)

During the operation of the main program, it is printed as follows:

Ubuntu18.04 (Python3.9) Error: ImportError: Cannot import name ‘sysconfig’ from ‘distutils’

1. Error reporting when using PIP:

 1 Traceback (most recent call last):
 2   File "/usr/bin/pip3", line 9, in <module>
 3     from pip import main
 4   File "/usr/lib/python3/dist-packages/pip/__init__.py", line 14, in <module>
 5     from pip.utils import get_installed_distributions, get_prog
 6   File "/usr/lib/python3/dist-packages/pip/utils/__init__.py", line 23, in <module>
 7     from pip.locations import (
 8   File "/usr/lib/python3/dist-packages/pip/locations.py", line 9, in <module>
 9     from distutils import sysconfig
10 ImportError: cannot import name 'sysconfig' from 'distutils‘

2. Solution:

2.1 installation pip

1 sudo apt-get install python3-pip

2.2 installing distutils

1 sudo apt-get install python3. 9-distutils

PS:Python3. For versions after 5, when installing distutils, you should install it with a specific version

sudo apt-get install python3.X-distutils

3. Installation succeeded

After all installations are successful, PIP – V can run normally and use pip.

[Solved] Python Error: ModuleNotFoundError : No Module named ‘pip._internal’

1. Error reporting when using PIP:

1 Traceback (most recent call last):
2   File "/usr/local/bin/pip", line 7, in <module>
3     from pip._internal import main
4 ImportError: No module named _internal

2. Solution:

Update pip

python3 -m pip install --upgrade pip
pip install --upgrade pip

3. Completion

After all updates are installed successfully, PIP – V can run normally and use pip.

[Solved] TestNg Package Error: Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!

Solution:

Add the following codes in the pom file:

<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>    <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

[Solved] PHP Error: ErrorException: preg_match(): Compilation failed: invalid range in character class at offset …

One day, the operator came over and said that it was useless to send the verification code by e-mail. As developers, it was our job to solve the problem.

First, check the error log and immediately find that PHP reported an error:

ErrorException: preg_match(): Compilation failed: invalid range in character class at offset 4

The error content means that the regular validation format is wrong and needs to be modified. However, we found no problems in the previous development and use, but recently.

This made us confused until we found that the PHP version of the server was changed from 7.2 to 7.3!

anger

After the difference, we found the cause of the problem:

Upgrade PHP from 7.2 to PHP 7.3

The writing of regular verification format is not standardized

The solution is also simple:

Upgrade the PHP Version (you can not do it, but it is recommended to keep it unified with the server)

Note whether special characters in regular format are escaped. For example, - in [] needs to be escaped: \-

[Solved] ADB Connect Error: failed to start daemon

Generally, the port is occupied. Find the process occupying the port and kill the process

1.netstat -ano | findstr :5037

Find the port occupation according to the log prompt (my prompt here is 5037, which depends on your own situation)

Most of them are 5037. It is estimated that the port is not normally released due to the previous abnormal exit of ADB, so it cannot be started normally

2. Tasklist | findstr 5756 (in this step, you can view the process information of the specific occupied port)

3. Kill the process occupying the port

Taskkill – F – PID 5756 (sometimes it cannot be killed directly in the windows task manager. It is recommended to use this command to kill)

Start virtual device

adb devices

You can query the equipment