Tag Archives: js

[Solved] /sockjs-node/info?t= net::ERR_SSL_PROTOCOL_ERROR

  Error: as shown in the following figure

After many ideological struggles, he began to solve the problem after admitting that it was his own problem:

  "apiUrl": "",
  "port":  "8080",
  "host": "",
  "socketHost": ""//Add this line to the json file to configure public (no comments can be written in the json)

In reference https://github.com/vuejs/vue-cli/issues/1472

After the discussion, the following solutions are found:

webpack.dev.conf.js file:


const URL = require('../static/config.json');
const socketHost = URL.socketHost;

Add content in devServer: {}:

public: socketHost,
disableHostCheck: true

Fortunately, the problem is solved!

[Solved] Syntax Error: TypeError: Cannot read property ‘parseComponent‘ of undefined

Syntax Error: TypeError: Cannot read property ‘parseComponent’ of undefined
Vue packages version mismatch

Failed to compile.

Module Error (from ./node_modules/vue-loader/lib/index.js):

Vue packages version mismatch:

- [email protected]10 (D:\site\hst_tech\hst_platform_frontend\node_modules\vue\dist\vue.runtime.common.js)
- [email protected] (D:\site\hst_tech\hst_platform_frontend\node_modules\vue-template-compiler\package.json)

This may cause things to work incorrectly. Make sure to use the same version for both.
If you are using [email protected]>=10.0, simply update vue-template-compiler.
If you are using [email protected]<10.0 or vueify, re-installing vue-loader/vueify should bump vue-template-compiler to the latest.


Set Vue template- [email protected] Version change Vue template- [email protected]

// Just change the version number to the same one
npm i -g [email protected] --save

Vue reports an error sasserror: expected newline

I used to be less in Vue. Today I tried sass on a whim, and then the error will be reported when running sasserror: expected newline

After studying for a long time, I found that there is a pit here. You can’t write sass in style if you use sass in Vue

It has to be written as SCSS  

  Change it so that you won’t report an error


Parsing error: await is a reserved word [How to Solve]

Problem: the error message is that a red wavy line appears in the editing of vscade. When the mouse is placed, it will prompt: parsing error: await is a reserved word. Parsing error: await is a reserved word, indicating that the editor does not recognize it and takes it as a keyword

Because an async keyword is added to the function outside the form verification, you want to write synchronization code in the callback function, but an error is reported.

// save
async save() {
  this.$refs.form.validateForm((valid) => {
    if (valid) {
      // The purpose of adding await is to wait for the save to complete before refreshing the list
      await /* this async reports an error */ this.saveRecord()

After modification:

save() {
// The async should be defined in front of the callback function (anonymous function) at this point.
// The external function and the callback function form two separate scopes.
// The function defined externally and the callback function form two block scopes,
// At this point, await and aysnc are not in the same scope, so they cannot be paired and an error is reported
 this.$refs.form.validateForm(async (valid) => {
   if (valid) {
   	 // The purpose of adding await is to wait for the save to complete before refreshing the list
     await /* No error is reported here for async */ this.saveRecord()

Summary: if you want to write synchronization code inside the callback function, you need to put the async keyword in front of the callback function to make async and await in the same scope

Solve the error of clearing data in object.assign in Vue

If you want to clear the data in Vue, the error may be the reason why you haven’t changed the direction of this. You can try to change the direction of this with call, for example

   Object.assign(this.$data,   this.$options.data.call(this))

If you just want to know one of the data, you can use it


[Solved] UMI Project Error: uncaught at _callee3 at _calle3

1. If it is just a react project and the DVA framework is introduced, an onerror attribute will be passed in when calling the DVA method

const app = dva({
	onError(err) {
		// error

2. If you are using the UMI framework, you cannot find the place where the DVA is called. Create a new app.js file in the SRC directory and write the following contents

export const dva = {
  config: {
    onError(e) {

Such a simple serialization system.text.json.serialization also reports an error?

Consulting area


I am going to switch json.net in the project to the native system. Text. JSON , but I encountered an unexpected error. The test code is as follows:

using System.Text.Json.Serialization;
using Newtonsoft.Json;

public class C {
  public C(string PracticeName) { this.PracticeName = PracticeName; }
  public string PracticeName;

var x = new C("1");
var json = JsonConvert.SerializeObject(x); // returns "{\"PracticeName\":\"1\"}"

var x1 = JsonConvert.DeserializeObject<C>(json); // correctly builds a C

var x2 = System.Text.Json.Serialization.JsonSerializer.Parse<C>(json);

The last line of the above code will report:

Exception thrown: 'System.NullReferenceException' in System.Text.Json.dll Object reference not set to an instance of an object.

What did I do wrong?

I found that this problem can be solved by parameterless constructor , but doing so will put the cart before the horse. Is there a flexible way to realize the simple functions that can be realized by JSON. Net .

Answer area

Christian Gollhardt:

In the . Net core 3.0 stage, the development of system. Text. JSON has not been completely completed. At present, only nonparametric constructor is supported, which may be supported in the future.

If you are migrating the old version to . Net core 3.0 , I still suggest you use newtonsoft. JSON .


Install the microsoft.aspnetcore.mvc.newtonsoftjason package from nuget and inject it into the Services container.



InstallMicrosoft.AspNetCore.SignalR.Protocols.NewtonsoftJson package from Nuget

new HubConnectionBuilder()


In this way, you can use json.net in . Net core 3.0 .


To solve this problem, you must make two changes:


    1. should be made into an attribute, not a field. Use a parameterless constructor

I wrote a console program, in which C1 is converted through newtonsoft. JSON , and C2 is converted through system. Text. JSON .

using Newtonsoft.Json;

namespace TestJsonParse
    class Program
        static void Main(string[] args)
            var c1 = new C1("1");
            var json1 = JsonConvert.SerializeObject(c1); // returns "{\"PracticeName\":\"1\"}"
            var x1 = JsonConvert.DeserializeObject<C1>(json1); // correctly builds a C1

            var c2 = new C2();
            string json2 = "{\"PracticeName\":\"1\"}";
            var x2 = System.Text.Json.Serialization.JsonSerializer.Parse<C2>(json2); // correctly builds a C2

        class C1
            public C1(string PracticeName) { this.PracticeName = PracticeName; }
            public string PracticeName;

        class C2
            public C2() { }
            public string PracticeName { get; set; }

Comment area

Times have changed. I’ve finished system.text.jason, and then I used the latest. Net 5 digression code.

namespace ConsoleApp3
    class Program
        static void Main(string[] args)
            var json = "{\"PracticeName\":\"1\"}";

            var x1 = JsonConvert.SerializeObject(json);

            var x2 = System.Text.Json.JsonSerializer.Deserialize<C>(json);


    public class C
        public C(string PracticeName) { this.PracticeName = PracticeName; }
        public string PracticeName;

The result is…. Continue to report errors…

What else can I say

Solve Google browser font reduction to 12px

The solution of browser font less than 12px

1. Zoom through transform: scale()

<div class="box text1">The font size is 12px</div>
<! -- inside before adding the span tag, because transform:scale scales the width and height of the outer div -->
<div class="box text2">
    <span> The font size is 8px</span> 
Copy code
    width: 200px;
    margin-bottom: 10px; 
    border: 1px solid red ;
    font-size: 12px;
.text2 span{
    display: inline-block;/*transform:scale()这This attribute scales only the elements whose width and height can be defined. */
    font-size: 16px;
    transform: scale(0.5) ;/* font-size: 16*0.5=8px  */
    transform-origin: left top;/* Adjustment of position*/