Tailwind css flex responsive

I have a problem using Flex in Tailwind CSS. When I use the flex class with flex-row, I want to make it responsive by using md:flex-col, lg:flex-col, and sm:flex-col. However, only one class is taking effect imidiately instead of the base flex-row class or then instead of reduce window.

For example, when I reduce the window size using the inspector, md:flex-col does not work as expected. Can you help me fix this issue?

This is my code

import React from "react";

const Resume = () => {
  return (
    <div className="flex flex-row flex-wrap gap-4 p-4 bg-gray-200 md:flex-col h-screen w-screen">
      <div className="p-4 bg-blue-500 text-white">Item 1</div>
      <div className="p-4 bg-green-500 text-white">Item 2</div>
      <div className="p-4 bg-red-500 text-white">Item 3</div>
    </div>
  );
};

export default Resume;

I want responsive when I reduce window then md:flex-col work not immediately effect on the screen.

Im getting error while deploying my react Vite app (Only shows white screen )

i tried deploying my app on vercel but the app only shows the blank white screen .

Is something wrong with my router configuration ?
its not showing my app.

when i run with npm run dev it shows me the correct ui ,
i also tried with npm run buld and previewed with npm run preview it shows me everything correctly .

but when i diploy it only shows me the white screen.

My vite.config.js

import { defineConfig } from "vite";
import tailwindcss from "@tailwindcss/vite";
import react from "@vitejs/plugin-react";

export default defineConfig({
  plugins: [tailwindcss(), react()],
  base: "/",
  build: {
    outDir: "dist",
    assetsDir: "assets",
  },
});

also i have included homepage in package.json

{
  "name": "smartkyc-admin",
  "homepage": "https://projects.vercel.app/",
   ....
   ....
}

This is what my folder structure looks

My vercel.json file

{
  "rewrites": [{ "source": "/(.*)", "destination": "/index.html" }]
}

My App.jsx file for reference

import { BrowserRouter, Routes, Route, Navigate } from "react-router-dom";
import { Toaster } from "react-hot-toast";
import Dashboard from "./pages/Dashboard";
import Login from "./pages/Login";
import Signup from "./pages/Signup";
import Layout from "./components/Layout";
import { AuthProvider, useAuth } from "./contexts/AuthContext";
import PropTypes from "prop-types";
import "./index.css";

function PrivateRoute({ children }) {
  const { user } = useAuth();

  if (!user) {
    return <Navigate to="/login" replace />;
  }

  return children;
}

PrivateRoute.propTypes = {
  children: PropTypes.node.isRequired,
};

function App() {
  return (
    <AuthProvider>
      <BrowserRouter basename="/">
        <Toaster position="top-right" />
        <Routes>
          <Route path="/login" element={<Login />} />
          <Route path="/signup" element={<Signup />} />
          <Route
            path="/*"
            element={
              <PrivateRoute>
                <Layout>
                  <Routes>
                    <Route path="/" element={<Dashboard />} />
                  </Routes>
                </Layout>
              </PrivateRoute>
            }
          />
        </Routes>
      </BrowserRouter>
    </AuthProvider>
  );
}

export default App;

Im getting error while deploying my react Vite app

i tried deploying my app on vercel but the app only shows the blank white screen ,
also i tried on netlify its the same issue .

when i run with npm run dev it shows me the correct ui ,

i also tried with npm run buld and previewed with npm run preview it shows me everything correctly .

My vite.config.js

import { defineConfig } from "vite";
import tailwindcss from "@tailwindcss/vite";
import react from "@vitejs/plugin-react";

export default defineConfig({
  plugins: [tailwindcss(), react()],
  base: "/",
  build: {
    outDir: "dist",
    assetsDir: "assets",
  },
});

also i have included homepage in package.json

{
  "name": "smartkyc-admin",
  "homepage": "https://projects.vercel.app/",
   ....
   ....
}

This is what my folder structure looks

My vercel.json file

{
  "rewrites": [{ "source": "/(.*)", "destination": "/index.html" }]
}

My App.jsx file for reference

import { BrowserRouter, Routes, Route, Navigate } from "react-router-dom";
import { Toaster } from "react-hot-toast";
import Dashboard from "./pages/Dashboard";
import Login from "./pages/Login";
import Signup from "./pages/Signup";
import Layout from "./components/Layout";
import { AuthProvider, useAuth } from "./contexts/AuthContext";
import PropTypes from "prop-types";
import "./index.css";

function PrivateRoute({ children }) {
  const { user } = useAuth();

  if (!user) {
    return <Navigate to="/login" replace />;
  }

  return children;
}

PrivateRoute.propTypes = {
  children: PropTypes.node.isRequired,
};

function App() {
  return (
    <AuthProvider>
      <BrowserRouter basename="/">
        <Toaster position="top-right" />
        <Routes>
          <Route path="/login" element={<Login />} />
          <Route path="/signup" element={<Signup />} />
          <Route
            path="/*"
            element={
              <PrivateRoute>
                <Layout>
                  <Routes>
                    <Route path="/" element={<Dashboard />} />
                  </Routes>
                </Layout>
              </PrivateRoute>
            }
          />
        </Routes>
      </BrowserRouter>
    </AuthProvider>
  );
}

export default App;

HTMX afterSwap and afterRequest events not raised on swapped content

A list of items with a “load more” button; the response will contain more items and a new button:

<div>Item 1</div>
<div>Item 2</div>
<div>Item 3</div>

<!-- ... -->

<div id="more">
  <button hx-get="/load-items?page=2"
          hx-on:htmx:after-swap="alert('swapped!')"
          hx-target="#more"
          hx-swap="outerHTML"
  >Load more<button>
</div>

The afterSwap and afterRequest events are not raised / handled. I assume that’s because it removes the original content?

How can I raise and handle the event despite the swap?

Angular CDK drag & drop cdk: Items change with animation

In angular 18 I have implemented a simple component using Angular drag & drop cdk (u can see better examples here):

import {Component} from '@angular/core';
import {
  CdkDrag,
  CdkDragDrop,
  CdkDragPlaceholder,
  CdkDropList,
  moveItemInArray,
} from '@angular/cdk/drag-drop';

@Component({
  standalone: true,
  selector: 'cdk-drag-drop-custom-placeholder-example',
  template: `<div cdkDropList class="example-list" (cdkDropListDropped)="drop($event)">
  @for (movie of movies; track movie) {
    <button (click)="moveUp(movie)">Up</button>
    <button (click)="moveDown(movie)">Down</button>
    <div class="example-box" cdkDrag>
      <div class="example-custom-placeholder" *cdkDragPlaceholder></div>
      {{movie}}
    </div>
  }
</div>`,
  styleUrl: 'cdk-drag-drop-custom-placeholder-example.css',
  imports: [CdkDropList, CdkDrag, CdkDragPlaceholder],
})
export class CdkDragDropCustomPlaceholderExampleComponent {
  movies = [
    'Episode I - The Phantom Menace',
    'Episode II - Attack of the Clones',
    'Episode III - Revenge of the Sith',
    'Episode IV - A New Hope',
    'Episode V - The Empire Strikes Back',
  ];

  moveUp(item: string) {
    const index = this.movies.indexOf(item);
    moveItemInArray(this.movies, index, index - 1);
  }

  moveDown(item: string) {
    const index = this.movies.indexOf(item);
    moveItemInArray(this.movies, index, index + 1);
  }

  drop(event: CdkDragDrop<string[]>) {
    moveItemInArray(this.movies, event.previousIndex, event.currentIndex);
  }
}

this simple code works and when dragging the movies around then there is animation which is moving them in the array,

The problem starts when using the buttons up/down to move the items,
they are switching places but instantly and with no animation at all.

I would love to know how to enable the animation when changing the array manually.
Thanks!

Unhandled Promise Rejection: TypeError: Spread syntax requires …iterable not be null or undefined [closed]

There is an array. Using the forEach() function, I want to list all the elements of this array, and then use the push() method to add other elements to it. However, why does the error “Unhandled Promise Rejection: TypeError: Spread syntax requires …iterable not be null or undefined” appear? Please tell me what I’m doing wrong.

const townList = computed(() => {
    const items: Town[] = [];
    filtredList.value.forEach((group) => {
      items.push(...group.towns);
    });
    return items;
});

When checking the array, Postman outputs the data.

Sequelize Model Not Creating Table in MySQL Database (TypeError: Cannot read properties of undefined (reading ‘define’))

I’m working on a Node.js project using Sequelize with MySQL. The database connection is established successfully, and sequelize.sync({ alter: true }) runs without errors, but my users table is not being created.

Additionally, I’m getting the following error when requiring my model:

TypeError: Cannot read properties of undefined (reading 'define')
at Object.<anonymous> (B:BuildsReact-Expressnakargoserverconfigmodelsuser.models.js:4:29)
at Module._compile (node:internal/modules/cjs/loader:1546:14)
at Object..js (node:internal/modules/cjs/loader:1689:10)
at Module.load (node:internal/modules/cjs/loader:1318:32)
at Function._load (node:internal/modules/cjs/loader:1128:12)
at TracingChannel.traceSync (node:diagnostics_channel:315:14)
at wrapModuleLoad (node:internal/modules/cjs/loader:218:24)
at Module.require (node:internal/modules/cjs/loader:1340:12)
at require (node:internal/modules/helpers:141:16)
at Object.<anonymous> (B:BuildsReact-ExpressnakargoserverconfigdbdbConnection.js:24:19)

Here’s my setup:

user.models.js file

const { Sequelize, DataTypes } = require("sequelize");
const { sequelize } = require("../db/dbConnection");

const userModel = sequelize.define(
  "User",
  {
    id: {
      type: DataTypes.UUID,
      defaultValue: Sequelize.UUIDV4,
      primaryKey: true,
    },
    name: {
      type: DataTypes.STRING,
      allowNull: false,
    },
    email: {
      type: DataTypes.STRING,
      allowNull: false,
      unique: true,
      validate: {
        isEmail: true,
      },
    },
    password: {
      type: DataTypes.STRING,
      allowNull: false,
    },
  },
  {
    tableName: "users", // ✅ Explicit table name
    timestamps: true,
  }
);

module.exports = userModel; // ✅ Ensure model is exported correctly

db/dbConnection.js file

const { Sequelize } = require("sequelize");
const {
  DATABASE_NAME,
  DATABASE_USER,
  DATABASE_PASSWORD,
  DATABASE_HOST,
  DATABASE_PORT,
} = require("../envExports");

const sequelize = new Sequelize(
  DATABASE_NAME,
  DATABASE_USER,
  DATABASE_PASSWORD,
  {
    host: DATABASE_HOST,
    port: DATABASE_PORT,
    dialect: "mysql",
    logging: console.log, 
  }
);


const userModel = require("../models/user.models"); 

// Function to test database connection
const initializeDB = async () => {
  try {
    await sequelize.authenticate();
    console.log("✅ Database connection established successfully.");

    await sequelize.sync({ alter: true }); 
    console.log("✅ All models were synchronized successfully.");
  } catch (error) {
    console.error("❌ Failed to connect to the database:", error.message);
    process.exit(1); // Exit on critical failure
  }
};

// Function to clean up the connection
const disconnectDB = async () => {
  try {
    await sequelize.close();
    console.log("✅ Database connection closed successfully.");
  } catch (error) {
    console.error(
      "❌ Error while closing the database connection:",
      error.message
    );
  }
};

module.exports = { sequelize, initializeDB, disconnectDB, userModel }; 

Issue:

  • sequelize.authenticate() works fine, and I see “✅ Database connection established successfully.”
  • sequelize.sync({ alter: true }) runs without errors, and “✅ All models were synchronized successfully.” appears in the logs.
  • However, the users table is not being created in MySQL. Running SHOW TABLES; in MySQL does not list users.
  • I have also tried sequelize.sync({ force: true }), but no table is created.

What I Have Tried:

  • Verified that MySQL is running and connected.
  • Checked Sequelize logs (logging: console.log)—no CREATE TABLE statement appears.
  • Restarted nodemon after every change.
  • Manually checked MySQL with SHOW TABLES;.
  • Tried explicitly calling userModel.sync({ force: true }).

Question:

  • Why is my Sequelize model not creating a table in MySQL, and how can I fix the TypeError: Cannot read properties of undefined (reading 'define') error?
  • Any insights would be greatly appreciated!

Upload excel file to Javascript NOT WORKING, NOT PROCESSING

Basically, my code is should allow the user to upload a data file (excel csv file), then use the data inside that uploaded file to create and plot charts and graphs. I have successfully created the upload file button, but once I upload the csv file, nothing is being drawn. I have a feeling there is something wrong in “this.handleFile = function(file)”, and the file is not being read or processed properly, but I’m not sure exactly what it is that’s causing this error.

This is the error I am getting on console:
enter image description here

FYI: The drawing and plotting part of the code is all working fine, since I have tested it out on another file, where the data file being used was a very specific File.

this.setup = function() 
  {
      this.fileInput = createFileInput(this.handleFile.bind(this));
      this.fileInput.position(width/2, 10);
        
      if (!this.loaded) 
      {
          console.log('Data not yet loaded');
          return;
      };

    this.select = createSelect();
    this.select.position(1080,42);

    var sd = this.data.columns;
    for(var i = 1; i < 8; i++)
        {
            this.select.option(sd[i]);
        };
  };
 
    
this.handleFile = function(file) 
{
    if (file.type === 'text') 
    {
        this.data = loadTable(file.data, 'csv', 'header', 
                              function(table) 
                              {
            self.loaded = true;
        });
    }
    return;
};

I’ve played around with the parameters of loadTable, removed the last parameter after header, I’ve tried calling setup in this.handleFile to let the code run again from setup after the data file is loaded.

The excel file NEEDS to be read and the data inside processed to draw things

Redirect to main page when user confirms refresh in React JS

How can I redirect the user to the main page when the user click on this green confirm button (it’s in french btw) :photo of the green confirm button when user clicks on reload button (it's in chrome)

I already have this in the app.js main component but when I try to use the useNavigate() with the navigate function it doesn’t work in the “handleBeforeUnload”. I also tried window.location.href = “/” but still doesn’t work.
Also, it’s a multiplayer game so I use socket.js to connect the client to a server (I don’t know if it changes anything, maybe it helps)

const handleBeforeUnload = (event) => {
        event.preventDefault();
        event.returnValue = ""; // Affiche une confirmation
    };

    useEffect(() => {
        window.addEventListener("beforeunload", handleBeforeUnload)

        return () => {
            window.removeEventListener("beforeunload", handleBeforeUnload)
        }
    }, [])

Second setTimeout lost with autofill Input fields

I have this standard form with User name / password.

enter image description here

When I go to my webpage with the browser I end up in this form and it’s empty. When I click the Name field it will autofill with a suggested option. So far so good.

On the input fields there is an oninputinput () handler function that calls the backend in PHP with jquery $.ajax in tophp (POST).

This is the issue. Both Name and Password are set with autofill but only the password ends up at the backend PHP. To be stored in the session. The request that will store the Name is lost. So when submitting this form the session doesn’t find the Name and it will give an error.

I find that the $.ajax call with the value for the Name input field is not fired. It’s lost somewhere and I don’t know why. Here is my code:

enter image description here

And here is the console.log after the autofill takes place. The first call is added to the timeout variable but never fires.

enter image description here

Any clue as to why the request is lost? This happens when I load the page. When I manually type Name and login, then logoff and use autofill, it will work accordingly. Both requests are written into the session.

Use Frdia Stalker for all threads

I want to use Frida Stalker for all the threads in the remote process.

The problem is that there are lot of threads in the process so if I tried to use Process.enumerateThreads to use Stalker.follow for each one of them the process crashed because that takes lot of time and until that the process is stop. `

I don’t want to handle the crashed (watchdog etc.) Is there another light way , maybe an API without thread id, so I can use Stalker.follow for all tids ?

Here is the example code

function StalkerExeample() 
{
    var threadIds = [];

    Process.enumerateThreads({
        onMatch: function (thread) 
        {
            threadIds.push(thread.id);
            console.log("Thread ID: " + thread.id.toString());
        },

        onComplete: function () 
        {
            
            threadIds.forEach(function (threadId) 
                {
                    Stalker.follow(threadId, 
                    {
                        events: {call: true , ret: true, exec: true ,block: true},
                    
                    onReceive: function (events)
                    {
                        console.log("onReceive called.");
                    },
                    onCallSummary: function (summary)
                    {
                        console.log("onCallSummary called.");
                    }
                });
            });
        }
    });
}


StalkerExeample();

AJAX Error on data.message return “undefined” [closed]

I am using Ajax to fetch data and send the data to google sheet.
However, the alert(data.message); is returning undefined but when I put **data.data.message it works.
**

Question: Why it is returning value if I will use data.data.message but not on data.message?

document.addEventListener('click', function(event) {
    if (event.target.classList.contains('book-now')) {
        let jobId = event.target.dataset.jobId; // Get job ID from button
        let row = event.target.closest('tr');

        fetch(jobBookingAjax.ajaxurl, { // Make sure this prints correctly in console
            method: 'POST',
            headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
            body: new URLSearchParams({
                action: 'book_job',
                nonce: jobBookingAjax.nonce,
                job_id: jobId
            })
        })
        .then(response => response.json())
        .then(data => {
            console.log(JSON.stringify(data));
            if(data.success) {
                alert(data.data.message);
                row.remove();
            }else{
                alert("Error: " + data.data.message);
            }
        })
        .catch(error => console.error('Error:', error));
    }
});

For some reason the alert(data.data.message); is working but not the data.message kind of weird.

Expected code should be alert(data.message);

Unable to get desired output for reactjs frontend project as css isn’t working while running on browser

Css for the current project my-dashboard is not working inside the browser on running the project through npm start.

I also tried installing, uninstalling, downgrading TailwindCSS multiple times. As in latest version in node_modules/tailwindcss/lib/cli.js lib folder does not existed. So current version now used is TailwindCSS v3.4.1.

package.json

{
  "name": "my-dashboard",
  "version": "1.0.0",
  "private": true,
  "scripts": {
    "start": "node scripts/start.js",
    "build": "node scripts/build.js",
    "test": "node scripts/test.js",
    "postinstall": "tailwindcss init -p"
  },
  "dependencies": {
    "@fortawesome/free-solid-svg-icons": "^6.7.2",
    "@fortawesome/react-fontawesome": "^0.2.2",
    "react": "^18.2.0",
    "react-dom": "^18.2.0",
    "react-scripts": "5.0.1"
  },
  "devDependencies": {
    "autoprefixer": "^10.4.20",
    "postcss": "^8.5.2",
    "tailwindcss": "^3.4.1"
  },
  "browserslist": {
    "production": [
      ">0.2%",
      "not dead",
      "not op_mini all"
    ],
    "development": [
      "last 1 chrome version",
      "last 1 firefox version",
      "last 1 safari version"
    ]
  }
}

postcss.config.css

module.exports = {
    plugins: {
      tailwindcss: {},
      autoprefixer: {},
    },
  };

tailwind.config.js

module.exports = {
  content: [],
  theme: {
    extend: {},
  },
  plugins: [],
}

index.html

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Jarvis CRM Dashboard</title>
    <link rel="stylesheet" href="%PUBLIC_URL%/index.css">
</head>
<body>
    <div id="root"></div>
</body>
</html>

Dashboard.js

import React, { useState, useEffect } from "react";
import Sidebar from "./components/Sidebar.js";
import DashboardCard from "./components/DashboardCard.js";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { faEnvelope, faBookmark, faUpload, faStar } from "@fortawesome/free-solid-svg-icons";
import "./index.css";

const Dashboard = () => {
    const [stats, setStats] = useState([]);
    const [currentPage, setCurrentPage] = useState("Dashboard");

    useEffect(() => {
        // Simulating API call
        setTimeout(() => {
            setStats([
                { icon: faEnvelope, label: "Messages", value: "1,410", color: "border-blue-500" },
                { icon: faBookmark, label: "Bookmarks", value: "410", color: "border-green-500" },
                { icon: faUpload, label: "Uploads", value: "13,648", color: "border-yellow-500" },
                { icon: faStar, label: "Likes", value: "93,139", color: "border-red-500" }
            ]);
        }, 1000);
    }, []);

 return (
    <div className="flex h-screen">
    {/* Sidebar */}
    <div className="w-64 bg-gray-800 text-white h-screen fixed">
        <Sidebar onMenuClick={setCurrentPage} />
    </div>
    
    {/* Main Content (Pushes aside for sidebar) */}
    <div className="flex-1 p-6 bg-gray-100 ml-64">
        <h1 className="text-xl font-bold">{currentPage}</h1>
        <div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4 mt-4">
            {stats.map((stat, index) => (
                <DashboardCard key={index} icon={stat.icon} label={stat.label} value={stat.value} color={stat.color} />
            ))}
        </div>
    </div>
</div>


    );
};


export default Dashboard;

index.css

@import "tailwindcss/base";

@import "tailwindcss/components";

@import "tailwindcss/utilities";

/* Global Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: Arial, sans-serif;
}

/* Layout */
.app-container {
    display: flex;
    height: 100vh;
    background-color: #f4f4f4;
}

/* Sidebar */
.sidebar {
    width: 250px;
    background-color: #fff;
    padding: 20px;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
}

.sidebar h2 {
    font-size: 18px;
    text-align: center;
    font-weight: bold;
}

.sidebar ul {
    list-style-type: none;
    padding: 10px 0;
}

.sidebar li {
    padding: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.sidebar li:hover {
    background-color: #e0e0e0;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 20px;
}

.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.card {
    padding: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
}

.card i {
    font-size: 30px;
    margin-right: 10px;
}

index.js

import React from "react";
import ReactDOM from "react-dom";
import Dashboard from "./Dashboard";
import "./index.css";

ReactDOM.render(
    <React.StrictMode>
        <Dashboard />
    </React.StrictMode>,
    document.getElementById("root")
);

reportWebVitals.js

const reportWebVitals = onPerfEntry => {
  if (onPerfEntry && onPerfEntry instanceof Function) {
    import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {
      getCLS(onPerfEntry);
      getFID(onPerfEntry);
      getFCP(onPerfEntry);
      getLCP(onPerfEntry);
      getTTFB(onPerfEntry);
    });
  }
};

export default reportWebVitals;

DashboardCard.js

import React from "react";

const DashboardCard = ({ icon, label, value, color }) => (
    <div className={`flex items-center p-4 bg-white shadow-md rounded border-t-4 ${color}`}>
        <i className={`fas fa-${icon} text-3xl mr-4`}></i>
        <div>
            <p className="text-sm text-gray-600">{label}</p>
            <p className="text-xl font-bold">{value}</p>
        </div>
    </div>
);

export default DashboardCard;

Sidebar.js

import React from "react";

const Sidebar = ({ onMenuClick }) => {
    const menuItems = [
        { name: "Dashboard", icon: "fa-home" },
        { name: "Departments", icon: "fa-building" },
        { name: "Projects", icon: "fa-folder" },
        { name: "Tasks", icon: "fa-tasks" },
        { name: "Task Status", icon: "fa-list" },
        { name: "Users", icon: "fa-users" },
        { name: "Roles", icon: "fa-user-tag" },
        { name: "Permissions", icon: "fa-lock" },
        { name: "Settings", icon: "fa-cog" },
        { name: "Activity Logs", icon: "fa-history" },
    ];

    return (
        <div className="w-64 bg-white h-full shadow-md p-4">
            <h2 className="text-center font-bold text-lg">Jarvis | A CRM</h2>
            <ul className="mt-4">
                {menuItems.map((item, index) => (
                    <li key={index} className="p-4 hover:bg-gray-200 cursor-pointer"
                     onClick={() => onMenuClick(item.name)}>
                        <i className={`fas ${item.icon} mr-3`}></i>
                        {item.name}
                    </li>
                ))}
            </ul>
        </div>
    );
};

export default Sidebar;

Folder paths images and other images are as follows:

Note: This is my first React or JavaScript project

In Adobe Javascript, how can I search a page for underlined or strikethru text?

Using javascript in Adobe Acrobat, I’m trying to identify each page in a pdf that has strikethru or underline, and save those pages into a new document. However, the this.getPageNthWord(p, n) seems to just return text, so I’m unable to detect if it has underline or strikethru.

Is there a version of getPageNthWord that returns rich text? This seems like it should be trivial. The documentation for adobe javascript is rather miserable, but maybe my googling is just failing me.

Here’s what I’ve got so far:

var pageArray = [];
for (var p = 0; p < this.numPages; p++) {
    // iterate over all words
    for (var n = 0; n < this.getPageNumWords(p); n++) {
    console.println(this.getPageNthWord(p, n))
        if ((this.getPageNthWord(p, n).style.strikeThru === true) || (this.getPageNthWord(p, n).style.underline === true)) {
            pageArray.push(p);
            break;
        }
    }
}

if (pageArray.length > 0) {
    // extract all pages that contain the string into a new document
    var d = app.newDoc();    // this will add a blank page - we need to remove that once we are done
    for (var n = 0; n < pageArray.length; n++) {
        d.insertPages({
            nPage: d.numPages - 1,
            cPath: this.path,
            nStart: pageArray,
            nEnd: pageArray,
        });
    }
    // remove the first page
   d.deletePages(0);
}