Rendering issues with zip extracted images in react

I am trying to make the user upload a zip file then extract only the image files inside the zip folder and then render them on the screen. However the rendering/re-rendering only happens when the code recompiles(i usually change a letter inside an html descriptor to do this) The regex part is gpt generated. The useEffect hook logs an empty array after the upload button is clicked but after a recompile it prints the full array. I couldnt find an answer anywhere else as this is some unusual behaviour by React.

import React, { useState, useEffect } from 'react';
import JSZip from 'jszip';

const ImageUploader = () => {
  const [selectedZipFile, setSelectedZipFile] = useState(null);
  const [extractedImages, setExtractedImages] = useState([]);
  const [change, setChange] = useState(0);

  useEffect(() => {
    if (extractedImages.length > 0) {
      console.log(extractedImages);
      // Trigger re-render when extractedImages state updates
      setChange(c=>c+1);
    }
  }, [extractedImages]); // Run this effect whenever extractedImages state changes

  const handleZipChange = (event) => {
    const file = event.target.files[0];
    setSelectedZipFile(file);
  };

  const handleUpload = async () => {
    if (!selectedZipFile) return;

    try {
      const zip = await JSZip.loadAsync(selectedZipFile);
      const imageFiles = [];

      zip.forEach(async (relativePath, zipEntry) => {
        if (zipEntry.dir || !zipEntry.name.match(/.(jpg|jpeg|png|gif)$/i)) return; // Skip directories and non-image files
        const blob = await zipEntry.async("blob");
        const dataUrl = await readBlobAsDataURL(blob);
        imageFiles.push({ name: zipEntry.name, dataUrl });
      });

      setExtractedImages(imageFiles); // Update extractedImages state

    } catch (error) {
      console.error('Error extracting images from zip file:', error);
    }
  };

  const readBlobAsDataURL = (blob) => {
    return new Promise((resolve, reject) => {
      const reader = new FileReader();
      reader.onload = () => resolve(reader.result);
      reader.onerror = reject;
      reader.readAsDataURL(blob);
    });
  };

  return (
    <div>
      <h2>Image Uploader</h2>
      <input type="file" accept=".zip" onChange={handleZipChange} />
      <button onClick={handleUpload} disabled={!selectedZipFile}>Upload Zip</button>
      {change > 0 && extractedImages.length > 0 && (
        <div>
          <h3>Extracted Images:</h3>
          {extractedImages.map((image, index) => (
            <img key={index} src={image.dataUrl} alt={image.name} style={{ maxWidth: '100%' }} />
          ))}
        </div>
      )}
    </div>
  );
};

export default ImageUploader;

$.ajax not working in Upgrade from Jquery 1.x to Jquery 2.x

I am trying to upgrade from JQyery 1.2.4 to JQuery 2.2.0 and later to 3.x.

But when updating from JQuery 1.x to 2.x, my existing $.ajax() functionality breaks.
In success/ done, I am getting resonse/data as ‘undefined’. But when I switch back to JQuery 1.x, then it works and captures response data.

I can see in browser’s Network tab, we are getting response as expected, but still not sure why I am getting response/data as ‘Undefined’.

Below is my ajax code example.

$.ajax({
    type: "GET",
    url: searchUrl,
    contentType: "application/json; charset=utf-8",
    cache: true,
})
.done(function (data) {
    console.log(data);
})

Unable to populate dynamic data in dialog using javscript

I am working on hybrid application using Angularjs and Angular 8.I am trying to populate data inside the dialog which contains paragraphs,inputs,textarea and label. When I click the icon to open the dialog, the dialog gets opened but it is not showing the data however when i change denter image description hereialog to div it shows. I am trying it for so long but nothing works. Any idea please ?

<dialog id="p-modal">
    <p>{{glPlmAsmt.data.summary}}</p>
    <button>Ok</button>
</dialog>

I have data in glPlmAsmt.data.summary which is fetched from server but it is not showing in dialog but shows in div

how do i validate regex for dash

I am trying to create regex validation for address which allow minimum 15 character and maximum 9999,
also its allow Number, Letters, and specific special character, also have required at least one letter

in Special character I need to allow space( /s), Comma (,), Single coat(‘) and dash (-),
all three are working fine but dash (-) is break all other invalid regex

Can you please let me know how can archive this solution

I am trying to below regex from https://regex101.com

^((?=.*[a-zA-Z])([a-zA-Z0-9s,'-]){15,9999})$

A81Seventh paradise, delhi,
A81 Seventh’s paradise, delhi,
A-81 Seventh paradise, delhi,
A#81 Seventh paradise, delhi,
A-8,
-81,

Devexpress angular validation callback checking duplicate values wrong

I am writing a validation callback method for checking the duplicates in devexpress grid component
ts file

    validationCallback(e: any) {  
        let isValid = true;
        for (let i = 0; i < this.abbreviation_array.length; i++) {
          if (this.abbreviation_array[i] === e.value && e.value !== undefined  ) {
            isValid = false;
            break;
          }
    
        }
        if (isValid === true ) {
          this.abbreviation_array.push(e.value);
          this.abbrev_flag = false;
         
        }
        else {
          this.abbrev_flag = true;
        }
        
        return isValid;
    
      }

html file

<dxi-column dataField="Abbreviation">
                <dxi-validation-rule type="custom" [reevaluate]= "false" [validationCallback]="validationCallback">
                </dxi-validation-rule>
            </dxi-column>```
But while coming to first element or any other previous element it puts flag to true as it is entered in array and validation_callback is evaluated everytime the cell is entered with value.
Please suggest how to solve this

TinyMCE – Image Source URL being changed to Relative, I need Absolute

I’m using TinyMCE, and I think I have the settings correct (as per the documentation in URL Handling) so that the URLs are handled as Absolute with Domain.

However, when I import some HTML (using another JavaScript) into the TinyMCE editor, or simply type a URL, it is always converted to a relative, which is no good when the content is then sent out as an email.

Here’s the TinyMCE Initialisation Code:

tinymce.init({
    selector: 'textarea#messageBody',
    height: 500,
    relative_urls: false,
    remove_script_host: false,
    document_base_url: '[https://My-Domain/]',
    menubar: false,
    plugins: 'advlist autolink lists link image charmap preview anchor searchreplace visualblocks code fullscreen insertdatetime media table code help wordcount',
    toolbar: 'undo redo | blocks | bold italic underline | alignleft aligncenter alignright alignjustify | bullist numlist | removeformat | link code help'
});

The document_base_url has my actual domain in there, with no square brackets… I’ve just put it like this in the post.
What’s strange is that, if I click the CODE button in the TinyMCE editor, add the full URL back in manually and click SAVE, and then go back to check the CODE again, the full URL path to the image has again been replaced by the Relative path.

I’ve seen various posts on this, but none of the solutions seem to work for me.

Anyone have any thoughts/ideas?

Thanks very much.

Error 500 when trying to POST data to opayo server via Fetch API

I am just trying to build a simple form that will redirect the user to the Opayo server payment page.

When using a BASIC html form, I get the correct response from https://sandbox.opayo.eu.elavon.com/gateway/service/vspserver-register.vsp (namely, the “NextURL”)

Example of the basic form

<form name='OpayoForm' id='OpayoForm' method='POST' action='https://sandbox.opayo.eu.elavon.com/gateway/service/vspserver-register.vsp'>
        <input type='hidden' id='VPSProtocol' name='VPSProtocol' value='4.0' />
        <input type='hidden' id='TxType' name='TxType' value='PAYMENT' />
        <input type='hidden' id='Vendor' name='Vendor' value='VENDORCODE' />
        <input type='hidden' id='VendorTxCode' name='VendorTxCode' value='VENDORTXCODE' />

        <input type='hidden' id='Amount' name='Amount' value='250.00' />
        <input type='hidden' id='Currency' name='Currency' value='GBP' />
        <input type='hidden' id='Description' name='Description' value='Test Payment' />
        <input type='hidden' id='NotificationURL' name='NotificationURL' value='https://www.myurl.com/notify/' />

        <input type='text' id='BillingSurname' name='BillingSurname' value='Surname' />
        <input type='text' id='BillingFirstnames' name='BillingFirstnames' value='Firstname' />
        <input type='text' id='BillingAddress1' name='BillingAddress1' value='Ad1' />
        <input type='text' id='BillingCity' name='BillingCity' value='City' />
        <input type='text' id='BillingPostCode' name='BillingPostCode' value='AA000AA' />
        <input type='text' id='BillingCountry' name='BillingCountry' value='GB' />
        <input type='text' id='BillingPhone' name='BillingPhone' value='01234567890' />

        <input type='text' id='DeliverySurname' name='DeliverySurname' value='Surname' />
        <input type='text' id='DeliveryFirstnames' name='DeliveryFirstnames' value='Firstname' />
        <input type='text' id='DeliveryAddress1' name='DeliveryAddress1' value='Ad1' />
        <input type='text' id='DeliveryCity' name='DeliveryCity' value='City' />
        <input type='text' id='DeliveryPostCode' name='DeliveryPostCode' value='AA000AA' />
        <input type='text' id='DeliveryCountry' name='DeliveryCountry' value='GB' />

        <input type='email' id='CustomerEMail' name='CustomerEMail' value='[email protected]' />

        <input type='hidden' name='Website' value='https://www.myurl.com/' />

        <input type='submit' name='submit' value='Pay Now' />
    </form>

But if I try to POST this data via the Fetch API I get a Error 500 in the console (and no other information to work from that I can tell.

Error 500

See JS below:

<script>
        async function FetchResponse() {
            var OpayoForm = document.getElementById('OpayoForm');
            /* //For creating post data in x-www-form-urlencoded format
            var data = [];
            for (let i = 0; i < (OpayoForm.elements.length - 1); i++) { //Loop the form, we aren't interested in the submit button. 
                data.push(encodeURIComponent(OpayoForm.elements[i].name) + "=" + encodeURIComponent(OpayoForm.elements[i].value));
            }
            data = data.join("&");
            */ 

            // For creating post data in form-data format
            var data = new FormData();
            for (let i = 0; i < (OpayoForm.elements.length - 1); i++) { //Loop the form, we aren't interested in the submit button. 
                data.append(OpayoForm.elements[i].name, OpayoForm.elements[i].value);
            }

            fetch("https://sandbox.opayo.eu.elavon.com/gateway/service/vspserver-register.vsp", {
            //fetch("https://www.myurl.com/testFetch.php", { //test page for checking Fetch is posting data
                    method: 'POST',
                    mode: "no-cors",
                    /*headers: {
                        //'Content-Type': 'application/x-www-form-urlencoded',
                        //'Content-Type': 'multipart/form-data',
                    },*/ //I have tried with and without headers to allow the browser to decide. 
                    body: data,
                })
                .then(response => response.text())
                .then((response) => {
                    var lines = response.split(/r?n|r|n/g);
                    var result = [];
                    for (let a = 0; a < lines.length; a++){
                        line = lines[a].split('=');
                        result[line[0]] = line[1];
                    }
                    console.log(result);//check result....
                    //window.location.href = result["NextURL"];//redirect to the payment page, would check this variable in production.
                })
                .catch(err => console.log(err))
        }
    </script> 

I have tried posting the data as url-encoded and as ‘form-data’ (comments left in the example above)

I have tested my fetch function by fetching my own page ‘testFetch.php’. This page simply outputs the POST data sent to it in the same format as Opayo…and this seems to work without issue.

<?php
foreach ($_POST as $key => $value) {
    echo $key;
    echo "=";
    echo $value . PHP_EOL;
}
?>

I am not sure what I have missed? As far as I can tell, the FetchResponse() function should be making the same request as the basic HTML form…

Extend a div’s width beyond 100% when user zooms

A div contains an SVG (D3 graph) and has its width set to 100%. The size cannot be set to a fixed point because the page should feel responsive.

Expected behaviour: When the user zooms in (ctrl +), the SVG should become bigger, more readable.

Actual behaviour: The SVG shrinks because the surrounding elements (header, navigation etc) take up more space, which means less space for the SVG. Zooming out makes the SVG grow.

What I’ve tried:

/* JS */
document.documentElement.style.setProperty('--zoom-ratio', `${window.devicePixelRatio}`)
/* CSS */
.foo-container {
    overflow: auto;
}
.foo {
    width: calc(var(--zoom-ratio) * 100%);
}

This works, as long as someone uses a screen with a 1:1 pixel ratio. 4k laptop displays are often set to 200-250%, which means that the SVG uses more than twice as much space as it should. How can I fix this?

Different output during event listener in Iframe

Problem is that I need to get URL from IFrame(baseURI) when I console log iFrameRef. It shows correct version of IFrame. But when I console log iFrameRef.current!.baseURI, it shows the old version of iFrame.

    useEffect(() => {
        const iframe = iFrameRef.current;
        if (iframe) {
            iframe.addEventListener('load', () => {
                console.log('IFRAME', iFrameRef);
                console.log('CURRENT', iFrameRef.current!.baseURI);
            });

            return () => {
                iframe.removeEventListener('load', () => {
                    console.log('removeEventListener', iFrameRef.current!.baseURI);
                });
            };
        }
    }, [dependency]);

‘dependency’ is when something happens to url inside of iframe.

I expect to get the last version of IFrame.

Why isn’t the defer working in this case on my laravel project?

I’m using a layout template to yield scripts and content as follows:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>@yield('title', 'The Gourmet')</title>
    <link rel="stylesheet" href="{{ asset('css/style.css') }}">
    @yield('scripts')
</head>
<body>
    @include('layout.employee.header')
    @yield('content')
    @include('layout.footer')
</body>
</html>

Then in my blade.php I have the following:

@extends('components.layout')

@section('title')
    {{ env('APP_NAME') . ' - Reserve' }}
@endsection

@section('scripts')
<script defer>
    let dateInput = document.getElementById('reservationDate');
    alert(dateInput.value);
</script>
@endsection

@section('content')
     <input type="date" name="reservationDate" id="reservationDate" min="{{ date('Y-m-d') }}" value="{{ date('Y-m-d') }}">
@endsection

The input has a value, and my script works if I place it underneath my input. But when I add my script through sections, it loads the script before my html and gives an “undefined” error because my input hasn’t loaded yet even though I’m using the ‘defer’ attribute ..

So I’m just trying to get my script to work after page load using the sections to place it in the head of my html. But it keeps loading if before it renders my html, even using the defer attribute.

How to add tooltip to a svg in javascript?

I have a menu with svg elements and I can drag and drop them on a container. What I want is to add a tooltip for each svg element so the user, when hovers the svg, knows what drops on container. My js code is a s follows:

(function () {
    'use strict';
    var shapesGroupName = 'editor.shapeSVG'; // used to organize and gropping the shapes, displayed in editor menu as label with expand/collapse 
    var typeId = 'proceng';          // used to identify shapes type

    var shapes = [
        {
            name: 'SVG1', ico: 'MyPath/SVG1.svg', content: [
                { id: '', type: 'path', attr: { d: 'M0,0h90' } },   
                { id: '', type: 'path', attr: { d: 'M0,22.5h22.51' } },   
                etc...        
            ]
        }, 
        {
            name: 'SVG2', ico: 'MyPath/SVG2.svg', content: [
                { id: '', type: 'path', attr: { d: 'M14,14 l200,0' } },   
                { id: '', type: 'path', attr: { d: 'M14,64 l50,0' } }, 
                etc...
            ]
        },  
        {
            name: 'SVG3', ico: 'MyPath/SVG3.svg', content: [
                { id: '', type: 'path', attr: { d: 'M27,27 l126,0' } },   
                { id: '', type: 'path', attr: { d: 'M22,72 l50,0' } },  
                 etc...
            ]
        }];

    // merge shapes groups        
    for (var i = 0; i < shapes.length; i++) {
        shapes[i].name = typeId + '-' + shapes[i].name;
    }
    if (svgEditor.shapesGrps[shapesGroupName]) {
        for (var i = 0; i < shapes.length; i++) {
            svgEditor.shapesGrps[shapesGroupName].push(shapes[i]);
        }
    } else {
        svgEditor.shapesGrps[shapesGroupName] = shapes;
    }
}());

enter image description here

So when the user covers the icon SVG3, a tooltip to be displayed with text “MySVG3”. How could I do it?

Updating a Svelte store value onMount doesn’t work

In one of my Svelte components, I’m trying to reset the count value in the store to 0 upon mounting the component.

Here’s how I’m attempting to do it:

<script>
    import { onMount } from "svelte";
    import { writable } from 'svelte/store';
    
    const myStore = writable({
      count: 1
    });
    
    function updateCount() {
    $myStore.count = 0;
    console.log("my store:", $myStore);
  }
    
  onMount(() => {
    updateCount();
    console.log("my store on mount:", $myStore); // count will be 1
  });
    
</script>

<!-- count is 1 -->
<h1>{$myStore.count}</h1>

However, upon rendering the component, I notice that the count value remains 1 instead of being updated to 0 as intended. Even though the updateCount() function is called inside the onMount hook, the console logs inside the hook show that the count is not updated.

For now to fix it I have it like this:

onMount(() => {
    setTimeout(() => {
      updateCount();
    }, 1);
  });

Thank you for your help!

Creating questions using Apps Script bring different results

Help, i have the following code to generate questions in App Script displayed in Google Form:

function clearMultipleChoiceQuestions() {
  var form = FormApp.openById(destinationForms); // Get the active form
  var items = form.getItems(FormApp.ItemType.MULTIPLE_CHOICE); // Get all multiple-choice items
  let sleepDurations = items.length*1000
  
  // Loop through each multiple-choice item and remove it
  for (var i = 0; i < items.length; i++) {
    
    form.deleteItem(items[i]); // Remove the item from the form
  }
  console.log("Sleeping for "+sleepDurations/1000+" second(s)")
  Utilities.sleep(sleepDurations)
}

function createMultipleChoiceQuestion(countRandomQuestion=2) {
  clearMultipleChoiceQuestions() // to delete all items before creating a new one
  let form = FormApp.openById(destinationForms); // Get the active form
  let questionList = getQuestionsAndChoice()
  let selectedQuestions = pickRandomQuestionsWithOptions(questionList,countRandomQuestion)
  let item = ""
  console.log("Generating Question...")
  for(var title in selectedQuestions){
    let question_title = selectedQuestions[title]['question']
    let question_choices = selectedQuestions[title]['options']
    console.log("Adding question: "+question_title)
    console.log("Adding choices: "+question_choices)

    // Add a multiple-choice question
    item = form.addMultipleChoiceItem();
     item.setTitle(question_title)
    .setChoiceValues(question_choices); // Set the choices for the question
  }
}

When i execute them from backend (app script), all went good:

  • Old Questions are deleted
  • New Questions are recreated

I applied some triggers:

  • form Submit
  • timer trigger per minute
    They didn’t work. They only deleted the questions without recreating new questions.

i’m confuse because we were executing the same scripts through different operations (app script backend manually click run script & trigger) bring different results.

How do i resolve this?

Javascript web bluetooth connections not working on chromebook

Im making a website for connecting to a bluetooth cutting device.

Im using the javascript web bluetooth api code.

I have tested on windows and apple and get no issues really. I can connect, and send the data to the machine. And I have tested it on chrome browser on all devices and it works except on chrome.

I am now testing on chromebook.
The bluetooth still connects to a device.
But when it comes to sending the data it returns the error

No Services matching UUID 0000180a-0000-1000-8000-00805f9b34fb found in Device.

Obviously these are all correct because they work on other OS.

Does anyone know why chromeOS might have different restrictions on bluetooth connections and where i can alter them?

I have tried changing some flags and no effect.
I will include below my log results from a windows machine and the chromebook.

Connection Process
Windows: 

>>> IMPORT NAVIGATOR
dotnet.native.8.0.1.y3hnxyz8dw.js:8 MODULE Lazy_ToString_ValueNotCreated
dotnet.native.8.0.1.y3hnxyz8dw.js:8 RRRRRRRDDDDDDDDAAAAAAAA
dotnet.native.8.0.1.y3hnxyz8dw.js:8 mmmmmmmmmmmmmmmmmmmm Microsoft.JSInterop.WebAssembly.WebAssemblyJSObjectReference
bluetoothControls.js:4 >>>js XXXXXXXXXXXXXXXXXXXXXXXXXXXXX requestDevice
bluetoothControls.js:23 >>>js requestDevice 3333 device  BluetoothDevice {id: 'dRtgl8alva981A1jnk8b4g==', name: 'Portrait 3-0', gatt: BluetoothRemoteGATTServer, ongattserverdisconnected: null}
bluetoothControls.js:24 >>>js requestDevice 3333 device  Portrait 3-0
bluetoothControls.js:28 >>> Connected
dotnet.native.8.0.1.y3hnxyz8dw.js:8 DDDDDDDDDDDDDDDDDDDDDDDD Portrait 3-0
dotnet.native.8.0.1.y3hnxyz8dw.js:8 im device and im init device
bluetoothControls.js:69 START READ VALUE.JS
bluetoothControls.js:48 >>> GET DEVICES >>>
bluetoothControls.js:54 >>> DEVICE [object BluetoothDevice] >>>
bluetoothControls.js:55 >>> GOT DEVICE >>>


bluetoothControls.js:83 >>> ARRAY 80,111,114,116,114,97,105,116,32,51 >>>
bluetoothControls.js:69 START READ VALUE.JS
bluetoothControls.js:48 >>> GET DEVICES >>>
bluetoothControls.js:54 >>> DEVICE [object BluetoothDevice] >>>
bluetoothControls.js:55 >>> GOT DEVICE >>>

bluetoothControls.js:83 >>> ARRAY 80,111,114,116,114,97,105,116,32,51 >>>


ChromeOS:
>>> IMPORT NAVIGATOR
dotnet.native.8.0.1.y3hnxyz8dw.js:8 MODULE Lazy_ToString_ValueNotCreated
dotnet.native.8.0.1.y3hnxyz8dw.js:8 RRRRRRRDDDDDDDDAAAAAAAA
dotnet.native.8.0.1.y3hnxyz8dw.js:8 mmmmmmmmmmmmmmmmmmmm Microsoft.JSInterop.WebAssembly.WebAssemblyJSObjectReference
bluetoothControls.js:4 >>>js XXXXXXXXXXXXXXXXXXXXXXXXXXXXX requestDevice
bluetoothControls.js:23 >>>js requestDevice 3333 device  BluetoothDevice {id: 'skGlrRzfXBcxQI6UHQboWA==', name: 'Portrait 3-0', gatt: BluetoothRemoteGATTServer, ongattserverdisconnected: null}
bluetoothControls.js:24 >>>js requestDevice 3333 device  Portrait 3-0
bluetoothControls.js:28 >>> Connected
dotnet.native.8.0.1.y3hnxyz8dw.js:8 DDDDDDDDDDDDDDDDDDDDDDDD Portrait 3-0
dotnet.native.8.0.1.y3hnxyz8dw.js:8 im device and im init device
bluetoothControls.js:69 START READ VALUE.JS
bluetoothControls.js:48 >>> GET DEVICES >>>
bluetoothControls.js:54 >>> DEVICE [object BluetoothDevice] >>>
bluetoothControls.js:55 >>> GOT DEVICE >>>


dotnet.native.8.0.1.y3hnxyz8dw.js:8 Canvas not connected to bluetooth: No Services matching UUID 0000180a-0000-1000-8000-00805f9b34fb found in Device.
dotnet.native.8.0.1.y3hnxyz8dw.js:8 undefined

I have tried reset my settings, turning on and off all bluetooth flags

Why worker threads aren’t working when creating an class instance from other file?

I have this typescript file:

import { Worker, WorkerOptions, isMainThread, parentPort } from "worker_threads";
import path from "path";

export class SimpleWorker {
    private worker: any;

    constructor() {
        if (isMainThread) {
            console.log('Resolved Path:', path.join(__filename));

            const resolvedPath = path.join(__filename)

            this.worker = this.worker = new Worker(resolvedPath, {
                execArgv: /.ts$/.test(resolvedPath) ? ["--require", "ts-node/register"] : undefined,
            });

            this.worker.on('message', (message: any) => {
                console.log(message);
            });

            this.worker.on('error', (error: any) => {
                console.log('Error from worker:', error);
            });

            this.worker.on('exit', (code: any) => {
                console.log('Worker has exited:', code);
            });

        } else {
            parentPort.postMessage('Hello from worker thread');
        }
    }
}

const simpleWorker = new SimpleWorker();

When executing the file using: npx ts-node examples/simple_worker.ts It will print:

Resolved Path: /home/user1/code/playground/examples/simple_worker.ts
Hello from worker thread
Worker has exited: 0

Now, when I remove the line const simpleWorker = new SimpleWorker(); from simple_worker.ts file.

And create another file called “test_worker.ts”

import { SimpleWorker } from './simple_worker';

const main = new SimpleWorker();

When executing this file using: npx ts-node examples/test_worker.ts It will print:

Resolved Path: /home/user1/code/playground/examples/simple_worker.ts
Worker has exited: 0

The threading didn’t work.. why?