Vue.js Error TypeError: Cannot read properties of undefined (reading ‘backend’)

i dont know how to solve this one on my final project, i try to find it anywhere but havent found it. help me guys

TypeError: Cannot read properties of undefined (reading 'backend')
    at _Engine.moveData (@tensorflow_tfjs.js?v=a02446f2:3915:29)
    at DataStorage.get (@tensorflow_tfjs.js?v=a02446f2:1638:22)
    at Object.reshape4 [as kernelFunc] (@tensorflow_tfjs.js?v=a02446f2:56356:41)
    at kernelFunc (@tensorflow_tfjs.js?v=a02446f2:4060:22)
    at @tensorflow_tfjs.js?v=a02446f2:4104:21
    at _Engine.scopedRun (@tensorflow_tfjs.js?v=a02446f2:3953:19)
    at _Engine.runKernelFunc (@tensorflow_tfjs.js?v=a02446f2:4098:10)
    at _Engine.runKernel (@tensorflow_tfjs.js?v=a02446f2:4014:17)
    at reshape_ (@tensorflow_tfjs.js?v=a02446f2:6554:17)
    at reshape__op (@tensorflow_tfjs.js?v=a02446f2:4702:22)

Up navigation from opensearch dashboards security analytics plugin

I need to move navigation from the security analytics plugin to the main navigation sidebar. I was able to move it and the transition only occurs if I am not inside the plugin.
For example, If I am in Discover and want to go to alerts (SAP), then I can do it, but if I want to go to rules(SAP) from alerts (SAP), then nothing will happen. The route will change, but the page does not react in any way.

What am i doing wrong in this Image slider project?

My code html and js

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>image slider</title>
    <script src="https://code.jquery.com/jquery-3.7.1.min.js" ></script>
    <style>
        .container {
            display: flex;
            align-items: center;
            justify-content: center;
            text-align: center;
            flex-direction: column;
        }
        #btn {
            cursor: pointer;
        }
    </style>
</head>
<body>
    <h1>Image Slider</h1>
    <div class="container">
        <img src="first.png" class="img" height="300px"><br>
        <button id="btn">~Slide~</button>
    </div>

    <script>
        let img = $(".img")[0]; 

        let images = ["first.png", "second.png", "third.png", "fourth.png", "fifth.png"];

        let current = 0;

        $("#btn").click(() => {
            current++;
            if (current >= images.length) {
                current = 0;
            }
            img.src = images[current];
        });
    </script>
</body>
</html>

Problem:

  • All files are in the same folder.
  • First image (first.png) loads correctly.
  • Clicking the button does nothing.

GSMArena API Proxy

I can’t find a way to add proxy to the gsmarena-api.

So far, I tried following codes but it ignores the proxy.

import { HttpsProxyAgent } from 'https-proxy-agent';

const proxyAgent = new HttpsProxyAgent('proxy_url');

const device = await gsmarena.catalog.getDevice('apple_iphone_13_pro_max-11089', {
    httpsAgent: proxyAgent
});
console.log(device);

wordpress wpml translation for custom post

I’ve created a custom post submission form for a specific category on my WordPress site. The form works fine for submitting posts, but there’s an issue with translation.

When a user submits a post using the form, the post is created but not translated immediately. However, if I then manually edit and save the post from the backend, it automatically gets translated as expected.

It seems like the translation is only triggered when a post is updated, not on the initial submission.

What I’ve tried so far:

Checked the form code and confirmed the correct category is assigned.

Verified that translation settings are working correctly for posts submitted through the WordPress dashboard.

Looked into hooks like save_post and wp_insert_post, but haven’t been able to trigger the translation on submission.

Tutorial for Google sign in using FedCM [closed]

I’ve gotten Google sign-in working on a sample Android app so wanted to get it to work for a web app as well. For this, I am using core-PHP, without Laravel, CI or any other framework. As per the documentation, the Google Sign-in Library is deprecated and I should be using FedCM API’s.

I have read the migration guide and blogs on FedCM, but as yet haven’t been able to find any tutorial on how to implement FedCM. Can someone kindly point me towards one?

Customise Express Check Out Screen using NVP/SOAP

Is it possible to customise the Express Checkout screen when calling it with API, e.g SetExpressCheckout, GetExpressCheckoutDetails, DoExpressCheckoutPayment

Ideally I would like to:

  1. Add my own image
  2. Remove the shipping details
  3. Restrict the payment options to PayPal Balance only
    3.1. Remove any card details
    3.2. Remove the ‘Link credit or debit card’ option
    3.3. Remove the ‘Pay in 4’ option
  4. Modify the ‘Cancel and return to ‘ link text

I have located express checkout variables but I am unable to use them in code, i.e. they have no effect. Having spent a few hours searching the web I am under the impression that customising the checkout experience is only possible with buttons created in the Paypal account

Output is ignoring decimal part using bcdiv

Code:

<?php
$a = "38.5";
$result = bcdiv(bcadd($a, "6"), "2", 100);
echo $result;
?>

Showing output:

22.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000

Expected output:

22.2500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000

React useState instantly calling the function I store in it as variable on re-render?

I am trying to make a filehandling system where you can delete the documents from the list of documents with the Delete button next to them. Upon clicking it, the usual pop-up window appears, asking for confirmation, and once clicking the Delete button there too, the file should be deleted. Problem is, that’s not what’s happening. The file is getting deleted right when the first Delete button is getting clicked. It would seem the useState in the App.js to which I pass the method that does the deleting calls it instantly on the re-render for some reason?

In the DocumentList.js:

    const deleteSetter = () => {
    
        const deleteFile = () => {
    
            handleClick(path, fileName)
        }
    
        deleteButtonSetter(deleteFile)
        deleteFileSetter(fileName)
        deleteWindowSetter(true)
    }

    return (

        ...

        <div className="document-buttons">

            ...

            <ButtonWithIcon
                index={1}
                imageComponent={<DeleteIcon/>}
                onClickFunction={deleteSetter}
            />

        </div>
    )

In the App.js:

    const [isDelete, setDelete] = useState(false)
    const [deleteFile, setDeleteFile] = useState(null)
    const [deleteButton, setDeleteButton] = useState(null)

    return (
    
        <div className="App">
    
          ...
    
          {isDelete ?
            (
              <DialogueWindow
    
                elements={
    
                  <FileDeleter
                    fileName={deleteFile}
                    deleteButtonSetter={deleteButton}
                    closeButtonSetter={setDelete}
                  />
                }
              />
            ) :
            null
          }
    
        </div>
     )

In the FileDeleter.js:

return (

    <div className="button-container">

                <DialogueButton
                    text="Delete"
                    isAvailable={fileName ? true : false}
                    onClickFunction={() => {
                        
                        deleteButtonSetter()
                    }}
                />

                ...

    </div>
)

What could be the issue? At no point do I use () after the name of the function, except when I finally call it in the FileDeleter’s onClick event. So why does it get called right at the useState update?

Set Start Date to Ajax Calendar Extender Control via Javascript

I have two textboxes on a webform (asp.net/c#) with each having the ajax calendar extender so when a user clicks in the textbox a calendar appears. The first one is date from while the second one is a date to. I want to be able to set the start date of the calendar extender of the date to, to be of the date selected in the date from.

I know this can be done by autopostbacking the textchange on the date from textbox then we can get the date from the textbox and apply to the To calendar extender, however I would prefer if there was a way we could do this without going back to the server. I am thinking javascript, we can find again look at the textchange of the textbox, like this

<asp:TextBox ID="txtFromDate" runat="server" onchange="javascript:SetToDate();"></asp:TextBox>

with the other textbox as

<asp:TextBox ID="txtToDate" runat="server"></asp:TextBox>
<act:CalendarExtender ID="calToDate" runat="server" PopupButtonID="imgPopUp" TargetControlID="txtToDate" Format="dd/MM/yyyy">
</act:CalendarExtender>

I was thinking I could have something like this in javascript

function SetToDate() {

    var datestart = new Date(document.getElementById('<%=txtFromDate.ClientID %>').value);
    document.getElementById('<%=calToDate.ClientID %>').StartDate = datestart;

}

However as you can see .StartDate does not belong like this, so how else can I apply the start date to calToDate via javascript.

Any help will be appreciated

Prisma model undefined even after npx prisma generate – timeSettings.findFirst is not a function

I’m working with a Next.js 15 app using Prisma with PostgreSQL. I recently added a new model TimeSettings to my schema.prisma, like so:

model TimeSettings {
id              String   @id @default(uuid())
minAdvanceHours Int      @default(2)
createdAt       DateTime @default(now())
updatedAt       DateTime @updatedAt    }

After that, I ran the following commands:

npx prisma generate
npx prisma db push

No errors during these commands. But when I try to use the model in my route like this:

const settings = await prisma.timeSettings.findFirst();

I get this runtime error:

TypeError: Cannot read properties of undefined (reading 'findFirst')

generator client {
  provider = "prisma-client-js"
  output   = "../generated"
}

datasource db {
  provider = "postgresql"
  url      = "postgresql://username:neondbstring?sslmode=require"
}

model User {
  id            String   @id @default(uuid())
  name          String
  email         String   @unique
  phone         String   @unique
  role          String
  photo         Json?
  createdAt     DateTime @default(now())
  updatedAt     DateTime @updatedAt
  isVerifiedOtp Boolean?
  driver        Driver?
}

model Driver {
  id                String    @id @default(uuid())
  userId            String    @unique
  email             String    @unique
  association       String
  licenseExpiry     String
  carType           String
  ac                Boolean
  carLicensePlate   String
  licenseFile       Json
  taxiBadge         Json
  carInsurance      Json
  operatorLicense   Json?
  carPhotos         Json[]
  applicationStatus String    @default("pending")
  statusUpdatedAt   DateTime  @default(now())
  trackingId        String    @unique
  totalEarnings     Float     @default(0)
  totalRides        Int       @default(0)
  adminNotes        String?
  available         Boolean?
  resubmissionLink  String?
  isOtpVerified     Boolean   @default(false)
  acceptedBookings  Booking[]
  user              User      @relation(fields: [userId], references: [id], onDelete: Cascade)
  offers            Offer[]
}

model Booking {
  id                String    @id @default(uuid())
  bookingId         String    @unique
  pickupCoords      Float[]
  destCoords        Float[]
  viaCoords         Json?
  pickupPoint       String
  destination       String
  via               String?
  customerName      String
  customerEmail     String
  customerPhone     String
  estimatedDistance Float
  estimatedFare     Float
  cartype           String
  pickupDate        String
  pickupTime        String
  status            String    @default("pending")
  pickup_status     String?
  driverNote        String?
  drivertoken       String?
  driverId          String?
  completedAt       DateTime?
  createdAt         DateTime  @default(now())
  updatedAt         DateTime  @updatedAt
  acceptedBy        Driver?   @relation(fields: [driverId], references: [id])
  offers            Offer[]
}

model Offer {
  id        String   @id @default(uuid())
  bookingId String
  driverId  String
  fare      Float
  status    String   @default("pending")
  createdAt DateTime @default(now())
  updatedAt DateTime @updatedAt
  booking   Booking  @relation(fields: [bookingId], references: [id], onDelete: Cascade)
  driver    Driver   @relation(fields: [driverId], references: [id], onDelete: Cascade)
}

model Admin {
  id            String  @id @default(uuid())
  email         String  @unique
  isOtpVerified Boolean @default(false)
}

model Otp {
  id        String   @id @default(uuid())
  email     String
  otp       String
  phone     String?
  createdAt DateTime @default(now())
  expiresAt DateTime
}

model Notification {
  id        String   @id @default(uuid())
  title     String
  message   String
  type      String
  recipient String
  data      Json
  read      Boolean  @default(false)
  createdAt DateTime @default(now())
}

model TimeSettings {
  id              String   @id @default(uuid())
  minAdvanceHours Int      @default(2)
  createdAt       DateTime @default(now())
  updatedAt       DateTime @updatedAt
}

lib/Prisma.ts

import { PrismaClient } from '@prisma/client'; // adjust path if needed

const globalForPrisma = globalThis;

const prisma = globalForPrisma.prisma ?? new PrismaClient();

if (!globalForPrisma.prisma) {
  globalForPrisma.prisma = prisma;
}

export default prisma;

lib/db.js

import { PrismaClient } from '@prisma/client';

const globalForPrisma = globalThis;

// Reuse existing PrismaClient in development
const prisma = globalForPrisma.prisma ?? new PrismaClient();

if (process.env.NODE_ENV !== 'production') {
  globalForPrisma.prisma = prisma;
}

export const connectDB = async () => {
  try {
    await prisma.$connect();
    console.log('✅ Database connected successfully');
    return prisma;
  } catch (error) {
    console.error('❌ Error connecting to database:', error);
    process.exit(1);
  }
};

export { prisma };
export default prisma;

time-settings route

import prisma from '@/lib/db';
import { NextResponse } from 'next/server';
import { connectDB } from '@/lib/db';

console.log(prisma); // In dev only — to inspect available models

// GET: fetch or initialize settings
export async function GET() {
  try {
     await connectDB()
    let settings = await prisma.timesettings.findFirst();

    if (!settings) {
      settings = await prisma.timesettings.create({
        data: {
          minAdvanceHours: 4,
        },
      });
    }

    return NextResponse.json({
      success: true,
      settings,
    });
  } catch (error) {
    console.error('Error fetching time settings:', error);
    return NextResponse.json(
      {
        success: false,
        message: `Failed to fetch time settings,${error}`,
      },
      { status: 500 }
    );
  }
}

// POST: update or create settings
export async function POST(request) {
  try {
     await connectDB()
    const data = await request.json();
    const { minAdvanceHours } = data;

    const existing = await prisma.timesettings.findFirst();

    let settings;
    if (existing) {
      settings = await prisma.timesettings.update({
        where: { id: existing.id },
        data: {
          minAdvanceHours,
        },
      });
    } else {
      settings = await prisma.timesettings.create({
        data: {
          minAdvanceHours,
        },
      });
    }

    return NextResponse.json({
      success: true,
      settings,
    });
  } catch (error) {
    console.error('Error updating time settings:', error);
    return NextResponse.json(
      {
        success: false,
        message: `Failed to update time settings, ${error}`,
      },
      { status: 500 }
    );
  }
}

// DELETE: remove all settings
export async function DELETE() {
  try {
     await connectDB()
    await prisma.timesettings.deleteMany();

    return NextResponse.json({
      message: 'Bro! Destruction is done',
      success: true,
    });
  } catch (error) {
    console.error('Error deleting time settings:', error);
    return NextResponse.json(
      {
        success: false,
        message: 'Failed to delete time settings',
      },
      { status: 500 }
    );
  }
}

Finally, Console.log Prisma response

 _clientVersion: '6.7.0',
      _errorFormat: 'colorless',
      _tracingHelper: Io {},
      _middlewares: [Jn],
      _previewFeatures: [],
      _activeProvider: 'postgresql',
      _globalOmit: undefined,
      _extensions: [e],
      _engine: [Qr],
      _appliedParent: [Object],
      _createPrismaPromise: [Function (anonymous)],
      '$metrics': [Fr],
      '$extends': [Function: Ka],
      constructor: [class r],
      '$use': [Function: $use],
      '$on': [Function: $on],
      '$connect': [Function: $connect],
      '$disconnect': [AsyncFunction: $disconnect],
      '$executeRawInternal': [Function: $executeRawInternal],
      '$executeRaw': [Function: $executeRaw],
      '$executeRawUnsafe': [Function: $executeRawUnsafe],
      '$runCommandRaw': [Function: $runCommandRaw],
      '$queryRawInternal': [AsyncFunction: $queryRawInternal],
      '$queryRaw': [Function: $queryRaw],
      '$queryRawTyped': [Function: $queryRawTyped],
      '$queryRawUnsafe': [Function: $queryRawUnsafe],
      _transactionWithArray: [Function: _transactionWithArray],
      _transactionWithCallback: [AsyncFunction: _transactionWithCallback],
      _createItxClient: [Function: _createItxClient],
      '$transaction': [Function: $transaction],
      _request: [Function: _request],
      _executeRequest: [AsyncFunction: _executeRequest],
      _hasPreviewFlag: [Function: _hasPreviewFlag],
      '$applyPendingMigrations': [Function: $applyPendingMigrations],
      user: [Object],
      driver: [Object],
      booking: [Object],
      offer: [Object],
      admin: [Object],
      otp: [Object],
      notification: [Object],
      '$parent': [Object],
      [Symbol()]: [Object]
    },
    [Symbol()]: {
      _originalClient: [Object],
      _runtimeDataModel: [Object],
      _requestHandler: [zn [RequestHandler]],
      _connectionPromise: undefined,
      _disconnectionPromise: undefined,
      _engineConfig: [Object],
      _accelerateEngineConfig: [Object],
      _clientVersion: '6.7.0',
      _errorFormat: 'colorless',
      _tracingHelper: Io {},
      _middlewares: [Jn],
      _previewFeatures: [],
      _activeProvider: 'postgresql',
      _globalOmit: undefined,
      _extensions: [e],
      _engine: [Qr],
      _appliedParent: [Object],
      _createPrismaPromise: [Function (anonymous)],
      '$metrics': [Fr],
      '$extends': [Function: Ka]
    }
  },
  [Symbol()]: {
    _originalClient: {
      _originalClient: [Object],
      _runtimeDataModel: [Object],
      _requestHandler: [zn [RequestHandler]],
      _connectionPromise: undefined,
      _disconnectionPromise: undefined,
      _engineConfig: [Object],
      _accelerateEngineConfig: [Object],
      _clientVersion: '6.7.0',
      _errorFormat: 'colorless',
      _tracingHelper: Io {},
      _middlewares: [Jn],
      _previewFeatures: [],
      _activeProvider: 'postgresql',
      _globalOmit: undefined,
      _extensions: [e],
      _engine: [Qr],
      _appliedParent: [Object],
      _createPrismaPromise: [Function (anonymous)],
      '$metrics': [Fr],
      '$extends': [Function: Ka]
    },
    _runtimeDataModel: { models: [Object], enums: {}, types: {} },
    _requestHandler: <ref *1> zn [RequestHandler] {
      client: [Object],
      dataloader: [Kn [DataLoader]],
      logEmitter: [EventEmitter]
    },
    _connectionPromise: undefined,
    _disconnectionPromise: undefined,
    _engineConfig: {
      cwd: 'D:\Prod_Ready\englishtaxis-nextjs-prisma\prisma',
      dirname: 'D:\Prod_Ready\englishtaxis-nextjs-prisma\node_modules\.prisma\client',
      enableDebugLogs: false,
      allowTriggerPanic: undefined,
      prismaPath: 'D:\Prod_Ready\englishtaxis-nextjs-prisma\node_modules\.prisma\client\query_engine-windows.dll.node',
      engineEndpoint: undefined,
      generator: [Object],
      showColors: false,
      logLevel: undefined,
      logQueries: undefined,
      env: [Object],
      flags: [],
      engineWasm: undefined,
      compilerWasm: undefined,
      clientVersion: '6.7.0',
      engineVersion: '3cff47a7f5d65c3ea74883f1d736e41d68ce91ed',
      previewFeatures: [],
      activeProvider: 'postgresql',
      inlineSchema: '// This is your Prisma schema file,n' +
        '// learn more about it in the docs: https://pris.ly/d/prisma-scheman' +
        'n' +
        '// Looking for ways to speed up your queries, or scale easily with your serverless or edge functions?n' +
        '// Try Prisma Accelerate: https://pris.ly/cli/accelerate-initn' +
        'n' +
        'generator client {n' +
        '  provider = "prisma-client-js"n' +
        '}n' +
        'n' +
        'datasource db {n' +
        '  provider = "postgresql"n' +
        '  url      = "xxxxxxxxxx"n' +
        '}n' +
        'n' +
        'model User {n' +
        '  id            String   @id @default(uuid())n' +
        '  name          Stringn' +
        '  email         String   @uniquen' +
        '  phone         String   @uniquen' +
        '  role          Stringn' +
        '  photo         Json?n' +
        '  createdAt     DateTime @default(now())n' +
        '  updatedAt     DateTime @updatedAtn' +
        '  isVerifiedOtp Boolean?n' +
        '  driver        Driver?n' +
        '}n' +
        'n' +
        'model Driver {n' +
        '  id                String    @id @default(uuid())n' +
        '  userId            String    @uniquen' +
        '  email             String    @uniquen' +
        '  association       Stringn' +
        '  licenseExpiry     Stringn' +
        '  carType           Stringn' +
        '  ac                Booleann' +
        '  carLicensePlate   Stringn' +
        '  licenseFile       Jsonn' +
        '  taxiBadge         Jsonn' +
        '  carInsurance      Jsonn' +
        '  operatorLicense   Json?n' +
        '  carPhotos         Json[]n' +
        '  applicationStatus String    @default("pending")n' +
        '  statusUpdatedAt   DateTime  @default(now())n' +
        '  trackingId        String    @uniquen' +
        '  totalEarnings     Float     @default(0)n' +
        '  totalRides        Int       @default(0)n' +
        '  adminNotes        String?n' +
        '  available         Boolean?n' +
        '  resubmissionLink  String?n' +
        '  acceptedBookings  Booking[]n' +
        '  user              User      @relation(fields: [userId], references: [id], onDelete: Cascade)n' +
        '  offers            Offer[]n' +
        '  isOtpVerified     Boolean   @default(false)n' +
        '}n' +
        'n' +
        'model Booking {n' +
        '  id                String    @id @default(uuid())n' +
        '  bookingId         String    @uniquen' +
        '  pickupCoords      Float[]n' +
        '  destCoords        Float[]n' +
        '  viaCoords         Json?n' +
        '  pickupPoint       Stringn' +
        '  destination       Stringn' +
        '  via               String?n' +
        '  customerName      Stringn' +
        '  customerEmail     Stringn' +
        '  customerPhone     Stringn' +
        '  estimatedDistance Floatn' +
        '  estimatedFare     Floatn' +
        '  cartype           Stringn' +
        '  pickupDate        Stringn' +
        '  pickupTime        Stringn' +
        '  status            String    @default("pending")n' +
        '  pickup_status     String?n' +
        '  driverNote        String?n' +
        '  drivertoken       String?n' +
        '  driverId          String?n' +
        '  completedAt       DateTime?n' +
        '  createdAt         DateTime  @default(now())n' +
        '  updatedAt         DateTime  @updatedAtn' +
        '  acceptedBy        Driver?   @relation(fields: [driverId], references: [id])n' +
        '  offers            Offer[]n' +
        '}n' +
        'n' +
        'model Offer {n' +
        '  id        String   @id @default(uuid())n' +
        '  bookingId Stringn' +
        '  driverId  Stringn' +
        '  fare      Floatn' +
        '  status    String   @default("pending")n' +
        '  createdAt DateTime @default(now())n' +
        '  updatedAt DateTime @updatedAtn' +
        '  booking   Booking  @relation(fields: [bookingId], references: [id], onDelete: Cascade)n' +      
        '  driver    Driver   @relation(fields: [driverId], references: [id], onDelete: Cascade)n' +       
        '}n' +
        'n' +
        'model Admin {n' +
        '  id            String  @id @default(uuid())n' +
        '  email         String  @uniquen' +
        '  isOtpVerified Boolean @default(false)n' +
        '}n' +
        'n' +
        'model Otp {n' +
        '  id        String   @id @default(uuid())n' +
        '  email     Stringn' +
        '  otp       Stringn' +
        '  phone     String?n' +
        '  createdAt DateTime @default(now())n' +
        '  expiresAt DateTimen' +
        '}n' +
        'n' +
        'model Notification {n' +
        '  id        String   @id @default(uuid())n' +
        '  title     Stringn' +
        '  message   Stringn' +
        '  type      Stringn' +
        '  recipient Stringn' +
        '  data      Jsonn' +
        '  read      Boolean  @default(false)n' +
        '  createdAt DateTime @default(now())n' +
        '}n',
      overrideDatasources: {},
      inlineDatasources: [Object],
      

I can’t get the “minimal” example of BIMSurfer v3 to work

I am trying to run the “minimal” BIMSurfer v3 example included in the latest BIMServer version. I have configured the URL to the server, the login credentials, and the project ID appropriately. After enabling the debug flag, I noticed in the browser console that both the login and project retrieval occurred successfully with no reported errors. However, it doesn’t download the 3D model, so nothing shows up on the canvas.

Is something missing? Do you have any suggestions for addressing the problem?

The TS version of the project has not changed; Today, there was a sudden error when starting TS1110 TS1005 TS1128 [closed]

[tsl] ERROR in /Users/pxy/Projects/node_modules/@types/react-router/ts4.6/index.d.ts(124,100)
TS1110: Type expected.

error in /Users/pxy/Projects/node_modules/@types/react-router/ts4.6/index.d.ts

[tsl] ERROR in /Users/pxy/Projects/node_modules/@types/react-router/ts4.6/index.d.ts(124,109)
TS1005: ‘}’ expected.

error in /Users/pxy/Projects/node_modules/@types/react-router/ts4.6/index.d.ts

[tsl] ERROR in /Users/pxy/Projects/node_modules/@types/react-router/ts4.6/index.d.ts(124,114)
TS1128: Declaration or statement expected.

error in /Users/pxy/Projects/node_modules/@types/react-router/ts4.6/index.d.ts

[tsl] ERROR in /Users/pxy/Projects/node_modules/@types/react-router/ts4.6/index.d.ts(124,115)
TS1128: Declaration or statement expected.

Greasemonkey/Tapermonkey userscript: Change relative links to absoulte links [duplicate]

A sample page:

https://www.rhymezone.com/r/rhyme.cgi?Word=much&org1=syl&org2=l&org3=y&typeofrhyme=perfect

contains many links, all of a particular class, that I need to change

A sample link:
https://www.rhymezone.com/r/d=dutch

Need to change it to this:
https://www.collinsdictionary.com/dictionary/english/dutch

(Using Tapermonkey on Firefox)

The page source shows this:
<a class="r dispr" href="/r/d=dutch">dutch</a>

So I try this:

// ==UserScript==
// @name Rhymezone Definition Links Modifier
// @description Redirect a rhymezone page's definition links from rhymezone to collinsdictionary.com
// @include https://www.rhymezone.com/r/*
// @version 1
// @grant none
// ==/UserScript==

function rewriteLinks()
{
var coll = document.getElementsByClassName('r dispr');
var l = coll.length;
for (var i=0; i<l; i++)
    {
        coll[i].href=coll[i].href.replace("/r/d=","https://www.collinsdictionary.com/dictionary/english/");
    }

}
rewriteLinks();

Which gives, on hover over & click on the word “dutch”:

https://www.rhymezone.comhttps//www.collinsdictionary.com/dictionary/english/dutch

Instead of:

https://www.collinsdictionary.com/dictionary/english/dutch


How to fix this?

Spotfire toggle shuffles back to left while navigating to different page

I’m encountering an issue with a toggle switch embedded inside a text area that allows users to switch between viewing the top 15 and bottom 15 sales on a bar chart. The logic for toggling between these two views works correctly. However, when I navigate away from this page and return, the toggle UI resets to the default “Top 15” position—even if I had previously selected “Bottom 15.” Despite this, the bar chart continues to display the bottom 15 values, leading to a mismatch between the toggle’s position and the chart’s data.

Text area code:-

this is a script of a text area 
<!-- Toggle UI Styles -->
<style>
.switch {
  position: relative;
  display: inline-block;
  width: 70px;
  height: 34px;
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #ccc;
  transition: .4s;
  border-radius: 34px;
}
.slider:before {
  position: absolute;
  content: "";
  height: 26px;
  width: 26px;
  left: 4px;
  bottom: 4px;
  background-color: Black;
  transition: .4s;
  border-radius: 50%;
}
input:checked + .slider {
  background-color: #f44336;
}
input:checked + .slider:before {
  transform: translateX(36px);
}
.label-text {
  font-family: Arial;
  font-size: 14px;
  margin: 0 10px;
}
.toggle-container {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
}
</style>



<!-- Toggle UI -->
<div class="toggle-container">
  <span class="label-text">Top 15</span>
  <label class="switch">
    <input type="checkbox" id="rankToggle">
    <span class="slider"></span>
  </label>
  <span class="label-text">Bottom 15</span>
</div>

<!-- Hidden buttons bound to IronPython scripts -->
<div style="display:none;">
<button id="setTop15" style="display:none;">Top</button>
<SpotfireControl id="0205d8e5efe047d5b9b8e885f864704f" />

<button id="setBottom15" style="display:none;">Bottom</button>
<SpotfireControl id="14d7f5c3deed4295af212cfacba2479d" />
</div>

<script>
document.getElementById("rankToggle").addEventListener("change", function() {
  if (this.checked) {
    document.getElementById("14d7f5c3deed4295af212cfacba2479d").click();
  } else {
    document.getElementById("0205d8e5efe047d5b9b8e885f864704f").click();
  }
});
</script>

On barchart, we have  Styles on x axis and Sum([TY Net Sales$]) on Y axis. 
Data limit using expression of bar chart is 
${TimeToggle} and If(
    Not ${RankSelectionToggleN},
    [SalesRank] <= 15,
    [SalesRank] >= (Max([SalesRank]) - 15 + 1)
)

SaleRank:- DenseRank(Sum(If(${TimeToggle},[TY Net Sales$],NULL)) Over ([Style]),"desc")

IronPython Script for Top 15:- Document.Properties["RankSelectionToggleN"] = False

IronPython Script for Bottom 15:- Document.Properties["RankSelectionToggleN"] = True

Any help would be greatly appreciated.

Thanks

Expecting toggle to work perfectly regardless of navigation across different pages