How do I prevent re rendering due to helper functions from a context provider in react?

I have been trying to optimise the my react code, my goal is to make sure existing toast components don’t re render when new ones are added. or when I delete one toast, rest of them don’t re render. all toasts live in toast provider.

current behaviour:

whenever I add a new toast, existing ones get re rendered.

whenever I remove a toast, the remaining ones get re rendered again.

Let me show some code first (only relevant part):

ToastProvider.jsx

function ToastProvider({ children }) {
  const [toasts, setToasts] = useState([])
  const memoisedClearToast = React.useCallback(() => setToasts([]), [])
  useKeyDown("Escape", memoisedClearToast)

  const addToast = (toast) => {
    setToasts([...toasts, toast]);
  };

  const dismissToast = (toastId) => {
    const nextToasts = [...toasts]
    const filtered = nextToasts.filter((toast) => toast.id !== toastId)
    setToasts(filtered)
  }

  const value = React.useCallback({ toasts, addToast, dismissToast }, [toasts])

  return (
    <ToastContext.Provider value={value}>
      {children}
    </ToastContext.Provider>
  )
}

ToastShelf.jsx:

function ToastShelf() {
  const {toasts} = useContext(ToastContext)
  console.log(`toast shelf render`)
  return (
    <ol>
      {toasts.map((toast) => {
        return (
          <li key={toast.id}>
            <Toast
              id={toast.id}
              variant={toast.variant}
              message={toast.message}
            />
          </li>
        )
      })}
    </ol>
  );
}
export default React.memo(ToastShelf);

Toast.jsx

function Toast({ id, variant, message }) {
  const { dismissToast } = useContext(ToastContext)
  console.log(`toast render`)
  return (
    <div>
      <button onClick={() => dismissToast(id)}>
        <X size={24} />
      </button>
    </div>
  );
}
export default React.memo(Toast);

All Toasts are getting re rendered whenever I add a toast, looking at the code, only prop that’s changing is coming via context and it’s dismissToast function. How can I make sure, that whenever new Toast is added to the toasts array in context, components depending only on the dismissToast function don’t get a fresh copy of dismissFunction ? The existing toasts don’t need to re render whenever new one is added right?

I haven’t been able to find a way around this. I have tried memoizing the value prop that is given to the context provider.

I have an Error in javascript When start quiz in Coursera

enter image description here“Problem starting this assessment
This is typically due to an unusually high volume of concurrent starts. If that’s the case, our systems are rapidly adjusting to accommodate the increased load.

Please try again after a few minutes. Your patience is greatly appreciated.

If this is an exam with a time limit: Rest assured that the timer will only start counting down once you’ve successfully started the exam.

Should the issue persist, please reach out to our support team.”

I cleared cookies and unenrolled and wait long time and talke to support
I didn’t have any solutoion

Shadow DOM Style Isolation

There seems to be an oddity in isolating Shadow DOM styles from the Main DOM styles, see the below.

In essence if I am specific about the tagName then there is isolation, but if I use * as the CSS selector then the style flows into the Shadow DOM. The issue here is that the Main DOM is using a style library which appears to do this, I’m not sure if there are other cases of the main DOM styling overflowing into the Shadow DOM, but this clearly is and everything I’ve read about Shadow DOM suggests there is full isolation.

class myTest extends HTMLElement {
    constructor () {
        super(); 
    }

    connectedCallback () {
        const shadow = this.attachShadow({ mode: 'closed' });
        const h1 = document.createElement('h1')
              h1.innerHTML = 'In Shadow DOM'
              shadow.appendChild(h1)
    }
   
}

customElements.define('my-test', myTest);
h1 { color: red }
* { 
  font-family: sans-serif
}
<h1>In main DOM</h1>
<my-test></my-test>

Typescript alias path not resolving on build

I am using typescript alias paths on my express app. After build the alias path not replace it with relative path and when I run my code with:

"start": "node ./dist/src/index.js"

It’s showing the following error:

$ node ./dist/src/index.js
node:internal/modules/cjs/loader:1075
  throw err;
  ^
Error: Cannot find module '@/routes/index'

My tsconfig file :

{
  "compileOnSave": true,
  "compilerOptions": {
    "strict": true, // used to strictly check the types of variables
    "target": "es2016",
    "lib": ["ES6"],
    "types": ["node", "express"],
    "module": "commonjs",
    "outDir": "./dist",
    "rootDir": ".",
    "sourceMap": true,
    "moduleResolution": "node",
    "noImplicitAny": true,
    "esModuleInterop": true,
    "allowSyntheticDefaultImports": true,
    "forceConsistentCasingInFileNames": true,
    "resolveJsonModule": true,
    "skipLibCheck": true,
    "noUnusedLocals": false, // used to check if any variable is not used
    "noUnusedParameters": false, // used to check if any parameter is not used
    "importHelpers": true,
    "baseUrl": "src",
    "paths": {
      "@/*": ["*"],
      "@config": ["config"],
      "@controllers/*": ["controllers/*"],
      "@middlewares/*": ["middlewares/*"],
      "@routes/*": ["routes/*"],
      "@utils/*": ["utils/*"],
      "@services/*": ["services/*"]
    },
  },
  "include": ["src/**/*.ts", "src/**/*.json", ".env"],
  "exclude": ["node_modules", "build"],
  "ts-node": {
    "require": ["tsconfig-paths/register"]
  }
}

Django websockets connection failed

I have hosted a django application on Linode which includes a chatting functionality. I am using django-channels to implement that functionality. I am not using any particular
technology like Redis, just the inbuilt django thing to implement the websockets because I am just testing the site for now. The following is the chatroom.html file:

{% extends 'common_anime_chat/base.html' %}
{% load static %}
{% block stylesheet %}
<link rel="stylesheet" type="text/css" href="{% static 'chatroom.css' %}">
{% endblock stylesheet %}
{% block content %}

<div class="chat-container">
    <div id="chat-messages" style='height: 75vh;'></div>
    <div id="input-container">
        <textarea id="input" rows="1"></textarea>
        <input type="button" id="submit" value="Send">
    </div>
</div>

{{ request.user.username|json_script:"user_username" }}
{{ request.user.profile.profile_picture.url|json_script:"user_pfp"}}
<script>
    const hardcodedProfilePictures = {
        'itsmyname': '/media/profile_pictures/profile1.png',
        'user123': '/media/profile_picturues/profile2.png',
        // Add more hardcoded profile pictures here for other usernames
    };

    document.querySelector('#submit').onclick = function (e) {
        const messageInputDOM = document.querySelector('#input');
        const message = messageInputDOM.value;
        chatSocket.send(JSON.stringify({
            'message': message,
            'username': userUsername,
            'user_pfp':userPfp,
            'room_name':roomName
        }));
        messageInputDOM.value = '';
    };

    const chatMessagesDOM = document.querySelector('#chat-messages');
    const userUsername = JSON.parse(document.getElementById('user_username').textContent);
    // console.log(userUsername)
    const pathArray = window.location.pathname.split('/');
    const roomName = pathArray[pathArray.length - 2]; // Use -1 if the room name is in the last segment

    let userPfp = JSON.parse(document.getElementById('user_pfp').textContent);

    // Object to store profile pictures associated with usernames
    let profilePictures = {};

    const chatSocket = new WebSocket(window.location.protocol === 'https:' ? 'wss://' : 'ws://') +
        window.location.host +
        '/chat/' +
        roomName +
        '/'
    );
    chatSocket.onopen = function (event) {
    console.log('WebSocket connection opened.');
};
console.log('WebSocket URL:', chatSocket.url);

chatSocket.onclose = function (event) {
    console.log('WebSocket connection closed.');
};

chatSocket.onerror = function (error) {
    console.log('WebSocket error:', error);
};


    chatSocket.onmessage = function (e) {
    const data = JSON.parse(e.data);

    const messageContainer = document.createElement('div');
    messageContainer.classList.add('chat-message');

    let profilePicture = document.createElement('img');
    profilePicture.src = data.user_pfp;
    profilePicture.alt = 'Profile Picture';
    profilePicture.style.maxHeight = '42px';
    profilePicture.style.borderRadius = '50%';
    profilePicture.classList.add('profile-picture');
    messageContainer.appendChild(profilePicture);

    const messageContent = document.createElement('span');
    messageContent.classList.add('message-content');

    const usernameSpan = document.createElement('span');
    usernameSpan.classList.add('username');
    usernameSpan.textContent = data.username + ': ';
    usernameSpan.style.color = 'white';
    messageContent.appendChild(usernameSpan);

    const messageSpan = document.createElement('span');
    messageSpan.textContent = data.message;
    messageSpan.style.color = 'white';
    messageContent.appendChild(messageSpan);

    messageContainer.appendChild(messageContent);

    chatMessagesDOM.appendChild(messageContainer);
};

    // Fetch and load profile pictures for each user
    fetch('/api/get_user_profile_pictures/') // Change this URL to the endpoint that provides profile picture URLs for all users
        .then(response => response.json())
        .then(data => {
            profilePictures = data;
            console.log(profilePictures)
        })
        .catch(error => {
            console.log(profilePictures)
            console.error('Error loading profile pictures:', error);
        });
    document.querySelector('#input').addEventListener('keydown', function (event) {
        if (event.key === 'Enter') {
            // Prevent the default behavior of Enter key (form submission)
            event.preventDefault();

            // Trigger the click event of the submit button
            document.querySelector('#submit').click();
        }
});
</script>
{% endblock content %}

The following is the routing.py file:

from django.urls import re_path
from . import consumers

websocket_urlpatterns = [
    re_path(r'^ws/chat/(?P<room_name>w+)/$', consumers.ChatRoomConsumer.as_asgi())
]

The following is the output in the console:

WebSocket connection to 'ws://my.ip.address/chat/AUdZzo8slKKwKvzmUrnmLRfnVkuAYfJj/' failed:
(anonymous) @ (index):92
(index):109 WebSocket error: Event {isTrusted: true, type: 'error', target: WebSocket, currentTarget: WebSocket, eventPhase: 2, …}

The site was working perfectly fine along with the Websockets on localhost.

Although it’s highly unlikely that there’s an error in my consumers.py file cuz I don’t think the code flow is even reaching there, the following is the consumers.py file:

import AsyncWebsocketConsumer
import json
from django.contrib.auth.models import User
# from channels.db import database_sync_to_async
from asgiref.sync import sync_to_async
from .models import ChatRoom, Message, Profile
from asyncer import asyncify

@sync_to_async
def save_message_to_database(chatroom_name, username, message):
    try:
        chatroom = ChatRoom.objects.get(name=chatroom_name)
        user = User.objects.get(username=username)
        user_profile = Profile.objects.get(user=user)

        new_message = Message.objects.create(chat_room=chatroom, sender=user_profile, content=message)
        print("Message saved to DB:", new_message)

    except ChatRoom.DoesNotExist:
        print(f"Chatroom with name '{chatroom_name}' does not exist.")
   
    except Profile.DoesNotExist:
        print(f"User profile with username '{username}' does not exist.")

    except Exception as e:
        print(f"Error occurred while saving the message: {e}")
@sync_to_async
def get_chatroom_by_name(name):
    try:
        return ChatRoom.objects.get(name=name)
    except ChatRoom.DoesNotExist:
        return None
@sync_to_async
def get_messages_for_chatroom(chatroom):
    return list(Message.objects.filter(chat_room=chatroom).order_by('timestamp'))

class ChatRoomConsumer(AsyncWebsocketConsumer):
    async def connect(self):
        self.room_name = self.scope['url_route']['kwargs']['room_name']
        self.room_group_name = 'chat_%s' % self.room_name
        await self.channel_layer.group_add(
            self.room_group_name,
            self.channel_name
        )
       
        await self.accept()
        print("Before getting chatroom")
        chatroom = await get_chatroom_by_name(self.room_name)
       
        print("chatroom:",chatroom)
   
        print("Chatroom:",chatroom)
        messages = await get_messages_for_chatroom(chatroom.id)
        for message in messages:
            print("SENDING MESSAGE TO FUNCTION")
            await self.send_message_to_client(message)
       


    async def send_message_to_client(self, message):
        user_id = await sync_to_async(lambda: message.sender.user_id)()
        user = await sync_to_async(lambda: User.objects.get(id=user_id))()
        print("SENDING MESSAGES TO THE FRONTEND")
        await self.send(text_data=json.dumps({
            'message': message.content,
            'username': user.username,
            'user_pfp': message.sender.profile_picture.url,
            'room_name': self.room_name,
        }))
   
    async def disconnect(self, close_code):
        await self.channel_layer.group_discard(
            self.room_group_name,
            self.channel_name
        )

    async def receive(self, text_data):
        text_data_json = json.loads(text_data)
        message = text_data_json['message']
        username = text_data_json['username']
        user_pfp = text_data_json['user_pfp']
        room_name = text_data_json['room_name']

        await save_message_to_database(chatroom_name=room_name, username=username, message=message)

        await self.channel_layer.group_send(
            self.room_group_name,
            {
                'type': 'chatroom_message',
                'message': message,
                'username': username,
                'user_pfp': user_pfp,
                'room_name': room_name,
                'tester_message': 'tester message in receive function'
            }
        )

    async def chatroom_message(self, event):
        message = event['message']
        username = event['username']
        user_pfp = event['user_pfp']

        await self.send(text_data=json.dumps({
            'message': message,
            'username': username,
            'user_pfp': user_pfp,
            'tester_message': 'tester message in chatroom message'
        }))

Please help me out with this problem!

Sort object by value in javascript [duplicate]

My ajax is returning the response as below.


    Array(7)
0
: 
{id: 1, name: 'A-DragonFruit'}
1
: 
{id: 2, name: 'A-Grapes}
2
: 
{id: 3, name: 'A-Mango'}
3
: 
{id: 4, name: 'A-Banana'}
4
: 
{id: 5, name: 'B-Kiwi'}
5
: 
{id: 6, name: 'A-Papaya'}
6
: 
{id: 7, name: 'B-SomeOtherFruit'}
7
length
: 
7
[[Prototype]]
: 
Array(0)
[[Prototype]]
: 
Object

Then I am just getting an Id and name from here using map function like below.

let data = {};
response.data.map((i) => { data[i.id] = i.name; });

But this sorts the object by id automatically in ascending order and gives the result sorted by id.

How can I create this object with id and name in ascending order of values (in my case fruits) and not by their id’s. I need Id and name both in my data object.

Thanks in advance.

Mapping Microsoft EllipticalArcTo to ECMA-376 arcTo

I have a use case where I have to convert parameters representing the arc of the ellipse. I have x, y, A, B, C, D from Microfost standart and I need to convert it to hR, stAng, swAng, wR from ECMA-376.

I tried to find similar questions solved.

I guess this link may be helpful.

It would be good to see convert realization in JS. But any help appreciated.

I tried this but I guess my geometry is weak. Can you please help?

How to remove a item from one object and then add that item to another object of same array in javascript?

I want to remove an item from one object and then add that item to another object of the same array in JavaScript. In the following array, I want to remove 2163 item from column-1 object. and then add 2163 to column-2 itemids.

[
{
    "id": "column-1",
    "title": "New",
    "itemIds": [
        "2163",
        "3477",
        "9639"
    ]
},
{
    "id": "column-2",
    "title": "Active",
    "itemIds": [
        "6018",
        "7028",
        "4491"
    ]
},
{
    "id": "column-3",
    "title": "Resolved",
    "itemIds": [
        "9156"
    ]
},
{
    "id": "column-4",
    "title": "Closed",
    "itemIds": [
        "3773",
        "6317",
        "6868"
    ]
}
]

I tried the following code

        let activeitemId = 2163;
        let truncatedvalue= columns[indexOfactiveColumn].itemIds.filter(function(e) { 
        return e !== activeitemId })
   
        let addedvalue =    [...columns[indexOfoverColumn].itemIds,activeitemId];
         const label = 'itemIds';
        const newValue = truncatedvalue;
        const addednewvalue = addedvalue;
        const updatedArray = [
          ...columns.slice(0, indexOfactiveColumn),
        {  
            ...columns[indexOfactiveColumn],
            [label]: newValue,
         
        },
          ...columns.slice(indexOfactiveColumn + 1),
         

        ];

        console.log('columnall-updatedArray',updatedArray); 

CORS error on client commuicating with web api

I programmed a Web-API using rust-axum and I made a client/frontend using just html and javascript Request. When I try to make a request from my client (opening the html file or serving a server e.g. via python -m http.serve) and making a request I got the following error:

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://127.0.0.1:3000/v1/auth/sign_in. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing). Status code: 405.

When I add .layer(CorsLayer::permissive()) to my server I can make the requests without any CORS issues, but I can’t set cookies anymore, which results in the users not beeing able to log in.
When I add .layer(CorsLayer::permissive().allow_credentials(true)) so I can set cookies again, I get the runtime error:

thread 'main' panicked at 'Invalid CORS configuration: Cannot combine `Access-Control-Allow-Credentials: true` with `Access-Control-Allow-Headers: *`', /home/mobergmann/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tower-http-0.4.4/src/cors/mod.rs:714:9

How can I change my configuration (client and/or server) so, that I can make Requests, not resulting in a CORS conflict, and be able to set cookies? The API should be public, meaning, that ay other user should be able to write their own client or hosts my client.

Trying to make a table in HTML using Flask and with data from SQL

I was trying to make a table in HTML using data from my database to populate the table. However, the table is showing up but there is no data present in the table. Can you guys please help?

This is my HTML Code with javascript

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>

<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">

<style>
    th{ 
        color:#fff;
            }
</style>


<table class="table table-striped">
    <tr  class="bg-info">
        <th>worker_id</th>
        <th>wokrer_name</th>
        <th>worker_type</th>
        <th>regular_hours</th>
        <th>hourly_rate</th>
        <th>overtime_rate</th>
    </tr>

    <tbody id="myTable">
        
    </tbody>
</table>

<script>
    var myArray = JSON.parse("{JSON_data}")
    
    buildTable(myArray)



    function buildTable(data){
        var table = document.getElementById('myTable')

        for (var i = 0; i < data.length; i++){
            var row = `<tr>
                            <td>${data[i].worker_id}</td>
                            <td>${data[i].worker_name}</td>
                            <td>${data[i].worker_type}</td>
                            <td>${data[i].regular_hours}</td>
                            <td>${data[i].hourly_rate}</td>
                            <td>${data[i].overtime_rate}</td>
                      </tr>`
            table.innerHTML += row


        }
    }

</script>

This is my Python Code

@app.route("/view_worker")
def view_worker():
  f = open("templates/view_worker.html")
  page = f.read()
  f.close()
  cursor.execute("""
    SELECT
      *
    FROM workers
  """,
  )
  data = cursor.fetchall()
  worker_data = []
  for row in data:
    worker = {"worker_id":row[0], "worker_name":row[1], "worker_type":row[2], "regular_hours":row[3], "hourly_rate":row[4], "overtime_rate":row[5]}
    worker_data.append(worker)
  worker_data = json.dumps(worker_data)
  page = page.replace("{JSON_data}", worker_data)
  return page

I am pretty new to python and html and I know nothing about javascript. I just saw a youtube tutorial on javascript and tried to reverse engineer his code to suit my needs.

I wanted tried to make a table which will show data in my database and dynamically become larger/smaller with the amount of data in the database. But sadly, it is not working and I have no clue on how to solve this.

If it helps, in the youtube tutorial, the array used was:

[
        {'name':'Michael', 'age':'30', 'birthdate':'11/10/1989'},
        {'name':'Mila', 'age':'32', 'birthdate':'10/1/1989'},
        {'name':'Paul', 'age':'29', 'birthdate':'10/14/1990'},
        {'name':'Dennis', 'age':'25', 'birthdate':'11/29/1993'},
        {'name':'Tim', 'age':'27', 'birthdate':'3/12/1991'},
        {'name':'Erik', 'age':'24', 'birthdate':'10/31/1995'},
    ]

And this was added directly in the html code rather than putting it in. I think this may be the mistake in my code as the data may not be in the correct format

`This app can’t run on your PC` error when launching an electron app

I am a beginner in Electron and working on a small personal project. The user sees a form with a few fields upon opening the app and when he submits the form, the data is appended to an excel sheet within the same directory.

The project is running locally without any issues (no errors or warnings in debugger) and when i build a desktop app using electron-builder --win (i’m on Mac so i have to give –win argument or else it creates an app for Mac), everything goes smoothly too.

But when i try to install/launch the app on a Windows PC, i get the This app can't run on your PC error.

I’ve tried a few online solutions but nothing seems to be working.

Can anyone with electron experience guide me as to what might be going wrong?

I tried to run in administrator mode, disabling anti-virus and then running, and a couple of other supposed solutions but nothing has worked so far.

Error on Launching App

javascript regex can not find and replace markdown codeblock correctly

I have installed a mermaid plugin for Gitbook via gitbook-plugin-mermaid-gb3, this plugin can parse code via markdown code block markup and translate it to a svg file, the code block is like below:

```mermaid
graph TD;
  A-->B;
  A-->C;
  B-->D;
  C-->D;
```

But when I use it I found for some code it will not working, after check I found it was a bug inside the plugin.

The code is come from index.js and related parse code listed below:

var mermaidRegex = /^```mermaid((.*[rn]+)+?)?```$/im;

function processMermaidBlockList(page) {

  var match;

  while ((match = mermaidRegex.exec(page.content))) {
    var rawBlock = match[0];
    var mermaidContent = match[1];
    page.content = page.content.replace(rawBlock, '<div class="mermaid">' +
      mermaidContent + '</div>');
  }

  return page;
}

The regex expression is /^```mermaid((.*[rn]+)+?)?```$/im,but it can only find code bock starts with “`mermaid,if there are space before or after it,it will not working

What I expected is like below

-- valid
```mermaid
graph TD;
  A-->B;
  A-->C;
  B-->D;
  C-->D;
```

-- valid, there can be space between ``` and mermaid
``` mermaid
graph TD;
  A-->B;
  A-->C;
  B-->D;
  C-->D;
```

-- valid, there can be space before or after ```
 ```mermaid
graph TD;
  A-->B;
  A-->C;
  B-->D;
  C-->D;
  ```
  
--invalid, there can not be have extra characters before ```
abc```mermaid
graph TD;
  A-->B;
  A-->C;
  B-->D;
  C-->D;
```  

--invalid, there can not be have extra characters before ```
abc ```mermaid
graph TD;
  A-->B;
  A-->C;
  B-->D;
  C-->D;
```  

--invalid, there can not be have extra characters after ```
```mermaid
graph TD;
  A-->B;
  A-->C;
  B-->D;
  C-->D;
```  abc

I changed /^```mermaid((.*[rn]+)+?)?```$/im to /s*```s*mermaid((.*[rn]+)+?)?```$/gm and test it via https://regex101.com/r/CIrooL/1,it seems okay,but not working inside javascript, I do not know why.

// this line will be blocked using the updated regex
while ((match = mermaidRegex.exec(page.content))) {
}

Can anyone help me,please?
Thanks in advance!

Can’t POST using Fetch

I’m having trouble posting data to an API using Fetch. I’ve simplified it to the following:

I created a simple PHP file at https://sophivorus.com/post.php with the following code:

<?php
echo json_encode( $_POST );

If I browse to it, open the dev console, and run the following simple command:

fetch( 'https://sophivorus.com/post.php', {
    method: 'POST',
} ).then( response => response.json() ).then( console.log );

I get a valid, empty JSON response. However, if I add a payload:

fetch( 'https://sophivorus.com/post.php', {
    method: 'POST',
    body: JSON.stringify( {
        foo: 'bar'
    } ),
} ).then( response => response.json() ).then( console.log );

I would expect to get a JSON response with the posted values. But I get the same, empty response. It seems that for some reason, my POST data is not getting posted.

I’m sure it must be something really stupid, but I just can’t see it. Any help would be most welcome, thanks!!

Javascript snippets have stopped working in VS Code

I have been using vscode to write javascript for about 6 months and since last 3-4 weeks, js snippets suddenly stopped working in my vscode. Js code runs perfectly fine but no js syntax error or suggestions or snippets is being shown by vscode when writing code .
It could be due to insatllling nodejs or git . I don’t know.
This message is shown by the js snippets extension ->

“Unknown language in contributes.JavaScriptSnippets.language. Provided value: vue”

I have tried deleting and installing vscode but that didn’t work.It would be highly appreciated if someone could help solve me this problem.

I deleted and re-installed vscode, disabled all the extensions. None of this worked.