Socket.io-client connection error in chrome extension

I am trying to build a chrome extension: a watch-party for the netflix but not able to configure the socket.io connections.

Here is the manifest.json file:

{
  "manifest_version": 3,
  "name": "Netflix Watch Party",
  "version": "1.0.0",
  "permissions": [
    "activeTab",
    "storage",
    "scripting",
    "webNavigation",
    "tabs",
    "notifications",
    "management"
  ],
  "host_permissions": [
    "*://www.netflix.com/watch*",
    "http://localhost:5000/*"
  ],
  "content_scripts": [
    {
      "matches": ["*://www.netflix.com/watch*"],
      "js": ["content.js"],
      "css": ["style.css"],
      "run_at": "document_start"
    }
  ],
  "background": {
    "service_worker": "background.js" 
  },
  "content_security_policy": {
    "extension_pages": "script-src 'self' http://localhost:5000; object-src 'self'"
  }
}

and the background file which I am using:

import io from 'socket.io-client';

const socket = io("http://localhost:5000/")

chrome.runtime.onInstalled.addListener((details) => {
  if (details.reason === "install") {
    chrome.tabs.create({
      url: "https://www.netflix.com/",
    });
  }
});

chrome.runtime.setUninstallURL(
  "https://www.jotform.com/form-templates/category/feedback", () => {
    chrome.windows.getCurrent((window) => {
      window.Clerk?.signout()
    })
});

chrome.webNavigation.onHistoryStateUpdated.addListener(function (details) {
  if (details.url.startsWith("https://www.netflix.com/watch")) {
    chrome.scripting.executeScript(
      {
        target: { tabId: details.tabId },
        function: () => {},
      },
      () => {
        chrome.scripting.executeScript(
          {
            target: { tabId: details.tabId },
            files: ["content.js"],
          },
          () => {
            chrome.scripting.insertCSS({
              target: { tabId: details.tabId },
              files: ["style.css"],
            });
          }
        );
      }
    );
  }
});

chrome.runtime.onMessage.addListener((message, sender, sendResponse) => {
      if(message.action == 'joinRoom'){
        console.log('Join room called')
        handleJoinRoom(message.payload);
      }
      else if(message.action == 'createRoom'){
        console.log('Create room called')
      handleCreateRoom(message.payload);
      }
      else if(message.action == 'sendMessage'){
        console.log('Send Message called')
       handleSendMessage(message.payload);
      }else{
        console.error('Unknown action:', message.action);
      }
})

function handleJoinRoom(payload) {
  const { roomId, username } = payload;
  console.log(`Joining room ${roomId} with username ${username}`);

  socket.emit("join room", { roomId, username });
}

function handleCreateRoom(payload) {
  const { roomId, username } = payload;
  console.log(`Creating room ${roomId} with username ${username}`);
  socket.emit('create room', {roomId, username });
}

// Function to handle sending a message
function handleSendMessage(payload) {
  const { roomId, username, message } = payload;
  console.log(`Sending message in room ${roomId} from ${username}: ${message}`);
  socket.emit("sendMessage", { roomId, username, message });
}

socket.on("user joined", (user) => {
  chrome.runtime.sendMessage({ action: "userJoined", payload: user });
});

socket.on("user left", (user) => {
  chrome.runtime.sendMessage({ action: "userLeft", payload: user });
});

socket.on("participants", (users) => {
  chrome.runtime.sendMessage({ action: "participants", payload: users });
});

socket.on("chat message", (message) => {
  chrome.runtime.sendMessage({ action: "chatMessage", payload: message });
});

I tried to found-out in the internet that it is some sort of issue with the background file and chrome apis working. Can anyone pls help with this.

XML Script running to print the required output

I have an sample XML input file with the following contents:

<?xml version="1.0" encoding="utf-8"?>
<infobases>
  <infobase author="Chartered Professional Accountants of Canada" levelDefOrder="Level 1,Level 2,Level 3,Level 4,Level 5,Level 6,Level 7,Level 8,Level 9,Level 10,Level 11,Level 12,Level 13,Normal Level" levels="Level 1,Level 2,Level 3,Level 4,Level 5,Level 6,Level 7,Level 8,Level 9,Level 10,Level 11,Level 12,Level 13" name="info_a" title="CPA Canada Standards and Guidance Collection">
    <file level="Level 1" heading="XYZ1-L1">XYZ1-L1
      <file level="Level 2" heading="XYZ1-L12">XYZ1-L12
        <file level="Level 3" heading="XYZ1-L123">XYZ1-L123</file>
        <file level="Level 3" heading="XYZ1-L123">XYZ1-L123</file>
        <file level="Level 3" heading="XYZ1-L123">XYZ1-L123</file>
      </file>
    </file>
    <file level="Level 1" heading="XYZ2-L1">XYZ2-L1</file>
    <file level="Level 1" heading="XYZ2-L1">XYZ2-L1
      <file level="Level 2" heading="XYZ2-L12">XYZ2-L12</file>
      <file level="Level 2" heading="XYZ2-L123">XYZ2-L123
        <file level="Level 3" heading="XYZ1-L123">XYZ1-L123
          <file level="Level 4" heading="XYZ1-L123">XYZ1-L123</file>
        </file>
      </file>
    </file>
  </infobase>
</infobases>

I want to write a script to identify the file elements level attribute and give proper indentation while printing the headings of the file element . The file element heading will get a .ditamap extension which has other file elements as child and ignore other child elements(not here in the sample xml file). If a file element has no child file element then it gets a .dita extension added.

I have written a script in javascript which tends to do the proper indentation but the extension assigned is not proper. I am getting .dita for all file element heading. Here is code :

const fs = require('fs');
const XmlStream = require('xml-stream');

// Create a readable stream from the XML file
const stream = fs.createReadStream('input1.xml');

// Create a writable stream to the output text file
const outputStream = fs.createWriteStream('output.txt');

// Create a new XML stream parser
const xmlParser = new XmlStream(stream);

// Function to print headings with proper indentation
function printHeadingsToFile(file, indentation = '') {
    // Calculate the indentation based on the level of the file
    const levelIndentation = '    '.repeat(parseInt(file.$.level.substr(6)) - 1);

        // Determine file extension based on child elements
        const fileExtension = file.file ? 'ditamap' : 'dita';
    
    // Write the heading with indentation to the output file
    outputStream.write(`${indentation}${levelIndentation}${file.$.heading}.${fileExtension}n`);

    // Check if there are nested files
    if (file.file) {
        // If nested files exist, recursively print their headings with increased indentation
        file.file.forEach(nestedFile => {
            printHeadingsToFile(nestedFile, `${indentation}${levelIndentation}`);
        });
    }
}


// Event listener for when a new XML element is encountered
xmlParser.on('startElement: file', function(element) {
    // Print headings for each file
    printHeadingsToFile(element);
});

// Event listener for when the parsing ends
xmlParser.on('end', function() {
    console.log('Parsing finished.');
    // Close the output stream after finishing writing
    outputStream.end();
});

// Event listener for any errors during parsing
xmlParser.on('error', function(err) {
    console.error('Error during parsing:', err);
    // Close the output stream if there is an error
    outputStream.end();
});

The output I am getting here is as follows:

XYZ1-L1.dita
    XYZ1-L12.dita
        XYZ1-L123.dita
        XYZ1-L123.dita
        XYZ1-L123.dita
XYZ2-L1.dita
XYZ2-L1.dita
    XYZ2-L12.dita
    XYZ2-L123.dita
        XYZ1-L123.dita
            XYZ1-L123.dita

Expected output:

XYZ1-L1.ditamap
    XYZ1-L12.ditamap
        XYZ1-L123.dita
        XYZ1-L123.dita
        XYZ1-L123.dita
XYZ2-L1.dita
XYZ2-L1.ditamap
    XYZ2-L12.dita
    XYZ2-L123.ditamap
        XYZ1-L123.ditamap
            XYZ1-L123.dita

How can i move this car (along with wheels) through X axis when clicking forward and backward button

This is my HTML file :

  <body>
    <div class="backgroundImg">
      <!-- <video autoplay loop muted>
      <source src="video.mp4" type="video/mp4">
    </video> -->
      <img src="Scene.jpg" alt="" />
    </div>
    <div class="buttons">
      <button class="forward"></button>
      <button class="backward"></button>
    </div>
    <div class="road"></div>
    <div class="wholecar">
      <div class="car"></div>
      <div class="wheel1">
        <img src="wheel1.png" alt="" />
      </div>
      <div class="wheel2">
        <img src="wheel2.png" alt="" />
      </div>
    </div>
    <script src="app.js"></script>
  </body>

This is my CSS code:

body,
html {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
}
/* CAR */

.car {
  height: 309px;
  width: 552px;
  background-image: url(carfinal.png);
  background-size: cover;
  background-repeat: no-repeat;
  position: absolute;
  left: 408px;
  top: 585px;
  z-index: 2;
  animation: CarMoves 1.5s linear infinite;
}

/* FRONT WHEEL */

.wheel1 img {
  width: 122px;
  position: absolute;
  top: 770px;
  left: 805px;
  animation: none;
  z-index: 3;
}
.wheel1 img.play-forward {
  animation: WheelRotate 0.5s linear infinite;
}
.wheel1 img.play-backward {
  animation: WheelRotate 0.5s linear infinite reverse;
}

/* BACK WHEEL */

.wheel2 img {
  width: 122px;
  position: absolute;
  top: 770px;
  left: 492px;
  animation: none;
  z-index: 3;
}
.wheel2 img.play-forward {
  animation: WheelRotate 0.5s linear infinite;
}
.wheel2 img.play-backward {
  animation: WheelRotate 0.5s linear infinite reverse;
}

/* CAR BODY WITH WHEELS */

/* .wholecar .car{
  z-index: 4;
  left:100px
}
.wholecar .wheel1 img{
  left: 500px;
}
.wholecar .wheel2 img{
  left: 185px;
} */

/* BUTTONS */

.buttons {
  display: flex;
  justify-content: center;
}
.forward {
  height: 80px;
  background-image: url(right.jpg);
  background-size: cover;
  width: 90px;
  border-radius: 10px;
  border: 1.5px solid red;
  position: absolute;
  top: 10vh;
  left: 105vh;
}
.backward {
  height: 80px;
  width: 90px;
  position: absolute;
  border-radius: 10px;
  border: 1.5px solid red;
  background-image: url(left.jpg);
  background-size: cover;
  top: 10vh;
  left: 80vh;
}

/* ANIMATIONS */

@keyframes WheelRotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

I have an HTML file with a structure that includes a background image or video, buttons for moving forward and backward, a road element, a car, and two wheels. The car and wheels have their own CSS styling and animations.

In my JavaScript code, I’ve added event listeners to the forward and backward buttons. When these buttons are clicked, corresponding CSS classes are toggled on the road, background image, and wheels to initiate animations.

However, I’m encountering an issue where the wheels aren’t moving along with the car when it moves forward or backward.

To address this, I’ve attempted to use the translate property on the .wholecar class to move the entire car along with its wheels. However, this approach didn’t work as expected.

I’m seeking assistance in resolving this issue so that when the forward or backward buttons are clicked, not only the background and road animate, but the car and its wheels move accordingly to create a realistic driving animation.

Why does the three.js stl loader not show anything?

I’m trying to render an STL in my react app by using the STL Loader from Three.js. It does not show anything on the canvas but also doesn’t throw any error. What could be the reason?

import "./App.css";
import { STLLoader } from "three/examples/jsm/loaders/STLLoader";
import { Canvas, useLoader  } from "@react-three/fiber";
import {  ArcballControls } from "@react-three/drei";
import { Suspense } from "react";
 
const Scene = ({ url }) => {
  const obj = useLoader(STLLoader, url);
  return <primitive object={obj}  scale={1} />;
};
 
 
export default function RenderedModelSTL ({ url }) {    
  return (
    <div className="model-wrapper">
      <Canvas camera={{fov: 18}} color="third">
        <Suspense fallback={"loading..."}>
          <ambientLight intensity={1} />
          <Scene url={url} />
          <ArcballControls />
        </Suspense>
      </Canvas>
    </div>
  );
}

Issue regarding the concept of nextInLine in Javascript

I have recently started learning Javascript, and came across the concept of nextInLine function. Upon reading about it I found out that it is a defined function which basically takes a queue and an item as arguments and returns the deleted element from the queue.

But my question is can’t any other function with a different name be used for the same purpose, and if yes why is nextInLine said to be a defined function in javascript?

React-native Expo prebuild failing. Error: ” The “paths[1]” argument must be of type string. Received an instance of Object”

After developing most of my app with react-native on expo, I’ve been trying to build it to check if it works by itself, but when prebuilding I’m running into this particular issue:

C:UsersspippolatorReactmyApp> npx expo prebuild
(node:25332) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
√ Created native directory | reusing /android
√ Updated package.json | no changes
× Prebuild failed
TypeError [ERR_INVALID_ARG_TYPE]: [android.dangerous]: withAndroidDangerousBaseMod: The "paths[1]" argument must be of type string. Received an instance of Object
TypeError [ERR_INVALID_ARG_TYPE]: [android.dangerous]: withAndroidDangerousBaseMod: The "paths[1]" argument must be of type string. Received an instance of Object
    at Object.resolve (node:path:171:9)
    at C:UsersspippolatorReactmyAppnode_modulesexpo-fontpluginbuildutils.js:11:45
    at Array.map (<anonymous>)
    at resolveFontPaths (C:UsersspippolatorReactmyAppnode_modulesexpo-fontpluginbuildutils.js:10:28)
    at C:UsersspippolatorReactmyAppnode_modulesexpo-fontpluginbuildwithFontsAndroid.js:15:70
    at action (C:UsersspippolatorReactmyAppnode_modules@expoconfig-pluginsbuildpluginswithMod.js:201:29)
    at interceptingMod (C:UsersspippolatorReactmyAppnode_modules@expoconfig-pluginsbuildpluginswithMod.js:105:27)
    at action (C:UsersspippolatorReactmyAppnode_modules@expoconfig-pluginsbuildpluginswithMod.js:206:14)
    at async interceptingMod (C:UsersspippolatorReactmyAppnode_modules@expoconfig-pluginsbuildpluginswithMod.js

I think it’s probably related to how I manage fonts, but I’ve been looking at the documentation and I dont see the problem
But given that I’m new to this framework I’m sure I’m missing something

This is how I manage fonts:

  const [fontsLoaded] = useFonts({
    'font1': require('./assets/fonts/firstfont.otf'),
    'font2': require('./assets/fonts/secondfont.ttf'),
    'font3': require('./assets/fonts/thirdfont.ttf'),
    'font4': require('./assets/fonts/fourthfont.otf'),
    'font5': require('./assets/fonts/fifthfont.ttf'),
  });

I then declared variables so that I can reference these fonts throughout the code more easily.

const titleFont = 'font1';
const headerFont = 'font1';

I tried also loading fonts by:

import font1 from './assets/fonts/firstfont.otf';
import font2 from './assets/fonts/secondfont.ttf';
import font3 from './assets/fonts/thirdfont.ttf';
import font4 from './assets/fonts/fourthfont.otf';
import font5 from './assets/fonts/fifthfont.ttf';

//and later

  const [fontsLoaded] = useFonts({
    'font1': font1,
    'font2': font2,
    'font3': font3,
    'font4': font4,
    'font5': font5,
  });

but it doesn’t change at all
And this is my app.json:

{
  "expo": {
    "name": "myApp",
    "slug": "myApp",
    "version": "1.0.0",
    "orientation": "portrait",
    "icon": "./assets/icon.png",
    "userInterfaceStyle": "light",
    "splash": {
      "image": "./assets/splash.png",
      "resizeMode": "contain",
      "backgroundColor": "#ffffff"
    },
    "assetBundlePatterns": [
      "**/*"
    ],
    "ios": {
      "supportsTablet": true
    },
    "android": {
      "adaptiveIcon": {
        "foregroundImage": "./assets/adaptive-icon.png",
        "backgroundColor": "#ffffff"
      },
      "package": "com.spippolator.myApp",
      "fonts": {
        "font1": "'./assets/fonts/fifthfont.ttf'",
        "font2": "./assets/fonts/secondfont.ttf",
        "font3": "./assets/fonts/thirdfont.otf",
        "font4": "./assets/fonts/fourthfont.ttf",
        "font5": "./assets/fonts/fifthfont.ttf"
      }
    },
    "web": {
      "favicon": "./assets/favicon.png"
    },
    "plugins": [
      [
        "expo-build-properties",
        {
          "android": {
            "usesCleartextTraffic": true
          }
        }
      ],
      [
        "expo-font",
        {
          "fonts": [
            { 
              "fonts": "./assets/fonts/larabiefont-free.rg-regular.otf"
            },
            {
              "fonts": "./assets/fonts/SvBasicManual-nRPP.ttf"
            },
            {
              "fonts": "./assets/fonts/hackerchaos.otf"
            },
            {
              "fonts": "./assets/fonts/Hacked-KerX.ttf"
            },
            {
              "fonts": "./assets/fonts/GlitchGoblin-2O87v.ttf"
            }
          ]
        }
      ]
    ],
    "extra": {
      "eas": {
        "projectId": "987944a8-f07f-4599-857e-8734584802e4"
      }
    }
  }
}

When I start my build it also says as a warning that: ”
I’m having a really hard time figuring this out, can anyone help me?
Thank you!

Tried changing fonts path, how I declare fonts, updating expo and some other stuff.
Also tried modifying app.json
Tried building a whole new project, still doesn’t work.

how to force in NextJs to use single click only

I’m using Flickity-React-Component for a swappable Carousel and passed NextJs <Link> to its children.

The problem is when click and swap the carousel, after releasing mouse click it opens that link
is there a way to force it to use single click?

Here’s my code :

 <Flickity
                options={{
                    freeScroll: true,
                    contain: true,
                    wrapAround : true,
                    prevNextButtons: false,
                    pageDots: false,
                    initialIndex: 2,
                }}>

                {slides?.length && slides.map((item, idx) => {
                    return (
                        // <Link key={`banner_${item.id}`} href={`/${item.shop_link}`}>
                        <div>
                            <Image src={item.src} />
                        </div>
                        // </Link>
                    )
                })}
            </Flickity>

sorry for my bad English

I’ve changed <Link> with onCLick event and it doesn’t work

Postman – Variable declared inside a parent folder, not seen as defined in child folder

I have this test in JavaScript in the Tests tab of the Parent folder (I will have the same 401 test in multiple child folders – to reduce duplications in test)

const response = pm.response.json();

pm.test("Status code is 401", ()=> {
    pm.response.to.have.status(401);
});

In the Child folder, I am trying to post a POST request, while having this test in the Tests tab:

pm.test('Error message', () => {
 pm.expect(response.error).to.eql('Missing Authorization header.');
})

I’m getting:

PASS
Status code is 401
FAIL
Error message | ReferenceError: response is not defined |

I understand that the 2nd test (the one in the child folder) is failing because the variable response is not defined in the Child folder.

My question is: why is the variable not passed from the Parent folder to the Child folder? As I can see, the 401 function is being passed, but the variable is not. I know the solution, I just do not understand the logic behind the variable not being passed, but the function is passed.

Setting the variable as a global variable in the parent folder script and then accessing the global variable in the child folder script works and is fully understood. What I do not understand is why, in my example, the function for testing the 401 status is being passed from the Parent folder to the Child folder, but not the variable response

after HTML form click need to change sub tags from input to something not editable

I have HTML form:

<div class="party-group party-group_has-items" data-field-name="accessLevels">
        here another HTML being generated when click on that "accessLevels" parent

<div class="form-group"><label class="control-label control-label_main">Department</label>
    <div class="form-group-content">
        <div class="form-field" data-editors="department">
            <div class="form-field_type_string">
                <span class="form-field__editor-wrapper">
                    <input type="text" class="form-field__editor form-field__editor_autosize"/>
                </span>
            </div>
        </div>
    </div>
</div>
</div>

I am trying to chnage th input tag to something not editable when click on the parent “accessLevels”. The change needs to be done only for “accessLevels” section

Currently found solution like this

    $(document).on('click', 'div[data-field-name="accessLevels"] .form-field__editor', function() {
        $('div[data-field-name="accessLevels"] .form-field__editor').prop('readonly', true);
    });

However, this readonly change happens not right away when I click on parent section
It’s make an effect when I click inside of child input form

please advice

Cannot read properties of undefined (reading ‘voucherno’)

const [formData, setFormData] = useState({
    date: "",
    voucherno: 0,
    cashinhand: "",
    totalpayment: "",
    totalreceipt: "",
    totaldiscount: "",
});
const handleAdd = () => {
    let lastvoucherno = 0;
    // Find the last entry with non-empty text
    for (let i = data.length - 1; i >= 0; i--) {
        if (data[i].text !== '') {
            lastvoucherno = parseInt(data[i].voucherno);
            break;
        }
    }
    const newvoucherno = lastvoucherno + 1;
    const newData = {
        date: "",
        voucherno: newvoucherno,
        cashinhand: "",
    };
    setData([...data, newData]);

When i run my application and then showing this error . This my code where i used voucherno. Can someone tell me the solution

Quickbooks API – How can i determine if the response is a Check, Expense, CC Credit or CC Expense?

I just want to ask regarding quickbooks API, because in the ‘Purchase’ endpoint, I researched that the Check, Expense, CC Credit and CC Expense are inside the Purchase endpoint, unlike Deposit, Bill, Invoice and Journal Entry, they have their own documentation. I just want to determine in the response if it is a Check, Expnse, CC Credit or CC Expense. Because I’m only receiving Cash and CreditCard payment type. I know nothing about accounting.

Cash transaction but I don't know if it is a CC Expense or CC Credit

This one is for Cash, and I don't know if it is an Expense or Check

Code to separate check, expense, cc credit, cc expense because as per intuit community, all of the other types are in the Purchase endpoint

In Cash, I consider a transaction with a DocNumber to be a check; otherwise, it is an Expense. However, I am uncertain about this.

Please help me.

Thank you! I really appreciate it!

I attempted to research it, but there are not many resources available. The objective is to gather all uncategorized expenses and input them into the database. However, I must identify the transaction type for each one. I can easily do this for deposits, bills, journal entries, and invoices, but for the other types, I am unable to do so.

Swiper JS wired behavior with lazy loading images in RTL direction

I have simple page here to show the problem. I’m using latest swiper version in RTL document to show some images slides as follow

<!DOCTYPE html>
<html lang="eng" dir="rtl">
<head>
    <title>test swiper</title>
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/swiper@11/swiper-bundle.min.css"/>
    <script src="https://cdn.jsdelivr.net/npm/swiper@11/swiper-bundle.min.js"></script>
    <style>
        .swiper {
            width: 100%;
            height: 300px;
        }
        .item-swiper-slide {
            width: 250px;
        }

        .item-swiper-slide:nth-child(n) {
            width: 250px;
        }
    </style>
</head>
<body>
<main>
    <div class="swiper">
        <div class="swiper-wrapper">
            <div class="swiper-slide item-swiper-slide">
                <img loading="lazy" src="samlpe.jpg" width="250" height="300" alt="test"/>
            </div>
            <div class="swiper-slide item-swiper-slide">
                <img loading="lazy" src="samlpe.jpg" width="250" height="300" alt="test"/>
            </div>
            <div class="swiper-slide item-swiper-slide">
                <img loading="lazy" src="samlpe.jpg" width="250" height="300" alt="test"/>
            </div>
            <div class="swiper-slide item-swiper-slide">
                <img loading="lazy" src="samlpe.jpg" width="250" height="300" alt="test"/>
            </div>
            <div class="swiper-slide item-swiper-slide">
                <img loading="lazy" src="samlpe.jpg" width="250" height="300" alt="test"/>
            </div>
            <div class="swiper-slide item-swiper-slide">
                <img loading="lazy" src="samlpe.jpg" width="250" height="300" alt="test"/>
            </div>
            <div class="swiper-slide item-swiper-slide">
                <img loading="lazy" src="samlpe.jpg" width="250" height="300" alt="test"/>
            </div>
            <div class="swiper-slide item-swiper-slide">
                <img loading="lazy" src="samlpe.jpg" width="250" height="300" alt="test"/>
            </div>
            <div class="swiper-slide item-swiper-slide">
                <img loading="lazy" src="samlpe.jpg" width="250" height="300" alt="test"/>
            </div>
        </div>

        <div class="swiper-pagination"></div>
        <div class="swiper-button-prev"></div>
        <div class="swiper-button-next"></div>
        <div class="swiper-scrollbar"></div>
    </div>
</main>
<script>
    const swiper = new Swiper('.swiper', {
        loop: true,
        pagination: {
            el: '.swiper-pagination',
        },
        navigation: {
            nextEl: '.swiper-button-next',
            prevEl: '.swiper-button-prev',
        },
        scrollbar: {
            el: '.swiper-scrollbar',
        },
    });
</script>
</body>
</html>

as you can see it is a full function code that show some simple slides that all contains only one img tag that load in lazy mode. if you check this page you can see images not loaded until you scroll over slides to make them loaded. but I found that if you remove dir=”rtl” from HTML tag, we can not see this problem.

additionally, I found that if i reduce number of slides to 2, 3 slides, it works without any problems. so i found that dir=”rtl” and number of slides more than 2,3 items cause this problem. but i want to use it in RTL documents and my slides is more that 20 slides.

i should mention that you can see this problem only with chrome browser.

please help me to solve this problem.

Livewire component does not get indexed when skeletton is loaded

Problem

I am working with PHP Livewire 3 and Volt and I encounter an issue when including a livewire skeletton for my component. After adding a skeletton the component does not get indexed right – means the search does work properly. I’ve tried to add wire:ignore to try preventing this isssue but that did not help me.

My Components

Parent-Component

<div class="mt-4 mx-8">

<sl-input wire:ignore wire:model.live="search" class="w-max" placeholder="Search for a monitor...">
    <sl-icon name="search" slot="prefix"></sl-icon>
</sl-input>

@php
$monitor_count = count($monitors);
@endphp

@if($monitor_count > 0)
@foreach($monitors as $monitor)
<div class="border-other-grey border-2 rounded-2xl mt-4" wire:key="{{$monitor->id}}">
    <livewire:monitors.card lazy="true" :monitor="$monitor" :key="$monitor->id" />
</div>
@endforeach
@else
<h1 class="text-primary-blue font-koulen text-2xl text-center">Currently no Monitors avaibale! </h1>
@endif

Child-Component
new class extends Component
{
use RepositoryCollector;

public $collect_repos_error;
public $error_head;

public Monitor $monitor;

public function mount(Monitor $monitor): void
{
    try {
        if ($monitor->repositories()->get()->isEmpty()) {
            $this->collect_repositories($monitor);
        }
        $this->monitor = $monitor;
    } catch (Exception $e) {
        $this->collect_repos_error = $e->getMessage();
        $this->error_head = "Seems like something went wrong...";
    }
}

public function reload_repositories()
{
    $this->monitor->repositories()->delete();
    $this->collect_repositories($this->monitor);

    $this->dispatch("repositories-updated", monitor_id: $this->monitor->id);
}

public function get_repositories()
{
    return $this->monitor->repositories()->get();
}


public function placeholder()
{
    return <<<'HTML'
    <center class="p-10" wire:ignore>
        <sl-spinner class="text-7xl" style="--track-width: 9px;"></sl-spinner>
    </center>
    HTML;
}

Reference

enter image description here

When searching...