Angular HttpClient interceptor: Error 429 returns status 0 instead of 429

I am working with an Angular HTTP interceptor and handling various error status codes. However, I have an issue with handling the 429 (Too Many Requests) error code. While the backend correctly responds with a 429 status in tools like Postman, in Angular, I receive errorResponse.status = 0 instead of 429 when the request returns this error.

When the backend responds with status codes 200, 500, or 401, my interceptor handles the errors correctly. But when the server responds with 429, errorResponse.status is set to 0.

I tested the same request in Postman, and the server correctly returns a 429, but this is not happening in Angular.

Here is a snippet of the interceptor code:

   intercept(request: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> {
        let accessToken = sessionStorage.getItem("access_token");
        if (request.url !== './assets/config/env.json') {
            request = request.clone({
                setHeaders: {
                    Authorization: `Bearer ${accessToken}`,
                    sid: `${this.config.getEnv('sid')}`,
                }
            });
        }
        return next.handle(request).pipe(
            tap(
                event => this.handleResponse(request, event),
                error => this.handleError(request, error)
            )
        );
    }
    handleError(req: HttpRequest<any>, errorResponse: HttpErrorResponse) {
        if (errorResponse.status === 429) {
            this.mostrarMensajeNoDuplicado("You have reached the user request limit, try again later.");
        } 
    }

How can I register a new event listener with a function without it overriding the old listener?

So I’ve been trying to make a game to learn some javascript, but whenever I try to create a new event listener through a function, e.g.

function event(target) {
    target.addEventListener('blur', doStuff);
}

then changing the target argument simply overrides any other event listeners created with the same function.

I have tried putting the event listener into its own function and tried adding arguments, as well as messing around with ordering, but nothing I do seems to work.

If you’ve encountered a situation where: Fetch works, response JSON is correct, but Nothing renders into the DOM [closed]

I’m running into a persistent issue where my frontend (plain HTML + JS) is sending a request to a FastAPI backend, receiving a valid JSON response, but nothing is rendered into the DOM.

Despite trying many debugging approaches, the final response just won’t appear in the designated <div>. Here’s a simplified breakdown.


✅ What works

  • HTML interface loads cleanly with a text input, submit button, and an empty <div id="replyPanel">.
  • JS captures the input and calls:
    fetch('http://127.0.0.1:8000/ask', {
        method: 'POST',
        headers: { 'Content-Type': 'application/json' },
        body: JSON.stringify({ prompt: userInput })
    })
    

How can I copy over records from one tab to another for a specified criteria?

Overview:

I’m attempting to copy records from one tab to another for a specified criteria. Copy source (Index) tab and destination (All Work Orders) tab.

When the function is initiated, the All Work Orders tab should only receive records where the value in Index column BR2:BR is equal to Index cell R6.
For example: If cell R6 = 05/01/2025 – 05/15/2025, copy records that meet that criteria from the Index tab to All Work Order tab.

Current issue:

When the function is executed, it’s coping All records from the Index tab regardless of the value in cell R6. Appears the where clause is not setup correctly.

Also, I noticed that the existing records in the All Work Orders tab are being overwritten by the copied values from the Index tab. The copied records should begin at the first available blank row and all previous records in the All Work Orders tab should be still intact.

function copyDatabase_25() {
  
var response=ui.alert("Complete Payment Processing Period", "Are you sure you want to finalize the Processing Period? By selecting YES, all Inspections within this designated date range will be copied to the All Work Orders tab.", ui.ButtonSet.YES_NO);

//checking the user response

            if(response==ui.Button.NO)
            {
            return; //exit from this function
            }

  var ss = SpreadsheetApp.getActiveSpreadsheet();
  var sheet = ss.getSheetByName("Index");
  var desinationsheet = ss.getSheetByName("All Work Orders");

  var startRow = 2; 
  var numRows = sheet.getLastRow() - startRow + 1; 
  var startCol = 24;
  var numCols = 44;
  var startColTarget = 1;
  var dataRange = sheet.getRange(startRow, startCol, numRows, numCols); 
  var data = dataRange.getValues(); 
  var Copy = "Copy"; 
  var firstEmptyRow = sheet.getRange("A2:AQ").getNextDataCell(SpreadsheetApp.Direction.DOWN).getRow() + 1;
  var dataToCopy = data.filter(row => row[2] !== Copy);

  //Get the cell value
  var selected_processing_pd = sheet.getRange("R6").getValue();

  var rangeValues = sheet.getRange("BR2:BR").getValues(); 

 // Compare and process
     for (var i = 0; i < rangeValues.length; i++) {
       for (var j = 0; j < rangeValues[i].length; j++) {
         if (rangeValues[i][j] == selected_processing_pd ) {

  desinationsheet.getRange(firstEmptyRow, startColTarget, dataToCopy.length, dataToCopy[0].length).setValues(dataToCopy);
         }
       }
     }

      ss.toast("The Inspections for the " + selected_processing_pd + " Payment Processing Pd, have been successfully copied to the All Work Orders tab")


}

INDEX tab, column BR

INDEX tab, cell R6

ALL WORK ORDERS tab

Postman stuck on sending request [closed]

Here is project link where i work :- https://github.com/Bikesh-1/BackendProject.git

Here image of postman screenshort

import express from 'express';
import cors from 'cors';
import cookieParser from 'cookie-parser';
import dotenv from 'dotenv';
dotenv.config({
    path: "./.env"
})




const app = express();

app.use(cors({
    origin: process.env.CORS_ORIGIN,
    credentials: true
}))

app.use(express.json());
app.use(express.json({limit:"16kb"}));
app.use(express.urlencoded({extended:true,limit:"16kb"}));
app.use(express.static("public"));
app.use(cookieParser());

//routes
import userRouter from "./routes/user.routes.js";



//routes declaration
app.use("/api/v1/users",userRouter)


export {app}

here is the code of app.js

Autodesk platform service aps-iot-extension viewer issue Error:404, 500

After the APS maintenance on February 2024, my APS-iot-extension model cannot work. https://github.com/autodesk-platform-services/aps-iot-extensions-demo

The Error includes: could not obtain the access token. Error code 404, Failed to load resource with a status of 500;
enter image description here, enter image description here

After I changed the tokenUrl:’/authentication/v1/authenticate’ to ‘/authentication/v2/token’under the path’./node_modules/forge-apis/arc/auth/OAuth2TwoLegged.js/’ in the aps-iot-extension file.

The result is that the error code did not exist. However, the 3D model cannot be displayed on ‘http://localhost:3000/’. enter image description here

The public config.js codes are as follows:

    export const APS_MODEL_URN = '******'
    export const APS_MODEL_VIEW = ''
    export const APS_MODEL_DEFAULT_FLOOR_INDEX = 1;

    export const DEFAULT_TIMERANGE_START = new Date('2025-01-01');
    DEFAULT_TIMERANGE_START.setHours(10, 30, 0, 0);
    export const DEFAULT_TIMERANGE_END = new Date('2025-01-31');
    DEFAULT_TIMERANGE_END.setHours(16, 30, 0, 0);
    The aps.js codes:
    
    

  const { AuthClientTwoLegged } = require('forge-apis');
  const { APS_CLIENT_ID, APS_CLIENT_SECRET } = require('../config.js');

  let publicAuthClient = new AuthClientTwoLegged(APS_CLIENT_ID, APS_CLIENT_SECRET, ['viewables:read'], true);

  async function getPublicToken() {
      if (!publicAuthClient.isAuthorized()) {
          await publicAuthClient.authenticate();
      }
      return publicAuthClient.getCredentials();
  }

  module.exports = {
      getPublicToken
  };
    The revised viewer.js codes:
    
    

export function initViewer(container, extensions) {
            return new Promise(function (resolve, reject) {
                Autodesk.Viewing.Initializer({ env: 'AutodeskProduction2', api: 'streamingV2', getAccessToken }, function () {
                    const viewer = new Autodesk.Viewing.GuiViewer3D(container, { extensions });
                    viewer.start();
                });
            });
        }
My config.js codes:

    

    const path = require('path');
    require('dotenv').config({ path: path.join(__dirname, '.env') });

    let { APS_CLIENT_ID, APS_CLIENT_SECRET, PORT } = process.env;
    if (!APS_CLIENT_ID || !APS_CLIENT_SECRET) {
        console.warn('Missing some of the environment variables.');
        process.exit(1);
    }
    PORT = PORT || 3000;

    module.exports = {
        APS_CLIENT_ID,
        APS_CLIENT_SECRET,
        PORT
    };

My package.json codes:

    {
      "name": "aps-iot2",
      "version": "0.0.0",
      "license": "MIT",
      "scripts": {
        "start": "node server.js"
      },
      "devDependencies": {
        "@types/chart.js": "^2.9.35",
        "@types/forge-viewer": "^7.61.0"
      },
      "dependencies": {
        "@aps_sdk/authentication": "^0.1.0-beta.1",
        "@aps_sdk/autodesk-sdkmanager": "^0.0.7-beta.1",
        "dotenv": "^16.0.3",
        "express": "^4.17.3",
        "mathjs": "^12.1.0",
        "mysql": "^2.18.1"
      }
    }
 

If the Autodesk platform service support team can help address this issue I will be very grateful.

Persistent ‘ReactCurrentOwner’ TypeError with React Three Fiber in Next.js 15.3.3 App (Firebase Studio)

I’m encountering a persistent TypeError: Cannot read properties of undefined (reading 'ReactCurrentOwner') when trying to integrate React Three Fiber (R3F) into my Next.js application, which is being developed in Firebase Studio. I’ve tried numerous troubleshooting steps but haven’t been able to resolve it.

Problem Description:

The application fails to render the R3F Canvas, throwing the following error in the browser console:

TypeError: Cannot read properties of undefined (reading 'ReactCurrentOwner')
    at $$$reconciler (webpack-internal:///(app-pages-browser)/./node_modules/react-reconciler/cjs/react-reconciler.development.js:498:46)
    at createRenderer (webpack-internal:///(app-pages-browser)/./node_modules/@react-three/fiber/dist/events-776716bd.esm.js:271:77)
    at eval (webpack-internal:///(app-pages-browser)/./node_modules/@react-three/fiber/dist/events-776716bd.esm.js:1778:5)
    // ... (rest of the stack trace as you provided, e.g.:)
    at (app-pages-browser)/./node_modules/@react-three/fiber/dist/events-776716bd.esm.js (https://6000-firebase-studio-1749286620707.cluster-3gc7bglotjgwuxlqpiut7yyqt4.cloudworkstations.dev/_next/static/chunks/_app-pages-browser_src_components_animations_ActualSophisticatedScene_tsx.js:68:1)
    at options.factory (...)
    at __webpack_require__ (...)
    // ...
    at ClientPageRoot (webpack-internal:///(app-pages-browser)/./node_modules/next/dist/client/components/client-page.js:20:50)

Environment Details:

Next.js: 15.3.3
React: 18.3.1
React DOM: 18.3.1
@react-three/fiber: alpha (e.g., ^8.17.0-alpha.0 – specify the exact alpha version if known from your lock file)
@react-three/drei: ^9.105.6 (or adjust to match the version installed alongside R3F alpha)
three: ^0.164.1 (or adjust to match the version installed)
Development Environment: Firebase Studio (Cloud-based IDE)
Node Version: v20.19.0
Browser: Chromium: 137.0.7151.68
Using Next.js App Router.
Relevant Code Snippets:

My R3F scene component (ActualSophisticatedScene.tsx):

'use client';

import React, { useState, useEffect, useMemo, useRef, Suspense } from 'react';
import { Canvas, useFrame, extend, useThree } from '@react-three/fiber';
import { OrbitControls, Text, Line, Html } from '@react-three/drei';
import * as THREE from 'three';

// Scene Settings
const LANDSCAPE_WIDTH = 200;
const LANDSCAPE_DEPTH = 150;
const HILL_AMPLITUDE = 8;
const HILL_FREQUENCY = 0.05;
const NUM_DATA_STREAMS = 60;
const LANDSCAPE_COLOR_DARK_BLUE = new THREE.Color('#0A101A');
const LANDSCAPE_COLOR_EARTH_TONE = new THREE.Color('#101C2A');
const STREAM_COLOR_CYAN = new THREE.Color('#00FFFF');
const STREAM_COLOR_WHITE = new THREE.Color('#E0E0E0');
const ENERGY_POINT_COLOR = new THREE.Color('#FFFFFF');
const SPROUT_STEM_COLOR = new THREE.Color('#34D399');
const SPROUT_LEAF_COLOR = new THREE.Color('#6EE7B7');
const SPROUT_GLOW_COLOR = new THREE.Color('#FFFFFF');


// Landscape Component
const Landscape: React.FC = () => {
  const meshRef = useRef<THREE.Mesh>(null!);
  const geometry = useMemo(() => {
    const geom = new THREE.PlaneGeometry(LANDSCAPE_WIDTH, LANDSCAPE_DEPTH, 40, 30);
    const { array } = geom.attributes.position;
    for (let i = 0; i < array.length; i += 3) {
      const x = array[i];
      const y = array[i + 1];
      array[i + 2] = (Math.sin(x * HILL_FREQUENCY) + Math.cos(y * HILL_FREQUENCY * 0.7)) * HILL_AMPLITUDE * (1 - Math.abs(x / LANDSCAPE_WIDTH)*0.5) ;
    }
    geom.computeVertexNormals();
    return geom;
  }, []);

  return (
    <mesh ref={meshRef} geometry={geometry} rotation={[-Math.PI / 2, 0, 0]} position={[0, -HILL_AMPLITUDE -5, 0]}>
      <meshStandardMaterial color={LANDSCAPE_COLOR_EARTH_TONE} flatShading={true} metalness={0.2} roughness={0.8} />
    </mesh>
  );
};

// DataStream Component
interface DataStreamProps {
  id: string;
  startPoint: THREE.Vector3;
  midPoint: THREE.Vector3;
  endPoint: THREE.Vector3;
  color: THREE.Color;
  animationPhase: 'tracing' | 'converging' | 'fading';
}

const DataStream: React.FC<DataStreamProps> = ({ startPoint, midPoint, endPoint, color, animationPhase }) => {
  const lineRef = useRef<any>();
  const [currentPoints, setCurrentPoints] = useState<THREE.Vector3[]>([startPoint, startPoint]);
  const [visible, setVisible] = useState(false);

  useEffect(() => {
    setVisible(true);
  }, []);

  useFrame((_state, delta) => {
    if (!lineRef.current || !visible) return;
    const speed = animationPhase === 'converging' ? 25 : 15;
    let progress = (lineRef.current.userData.progress || 0) + speed * delta;
    lineRef.current.userData.progress = progress;
    let curve;
    if (animationPhase === 'tracing') {
      curve = new THREE.QuadraticBezierCurve3(startPoint, midPoint, endPoint);
    } else {
      curve = new THREE.LineCurve3(startPoint, endPoint);
    }
    const pointsOnCurve = Math.min(Math.floor(progress), 50);
    if (pointsOnCurve < 2) {
      setCurrentPoints([startPoint, startPoint]);
      return;
    }
    const newPoints = curve.getPoints(pointsOnCurve -1);
    setCurrentPoints(newPoints);
    if (animationPhase === 'fading') {
      (lineRef.current.material as THREE.LineBasicMaterial).opacity -= 2.5 * delta;
      if ((lineRef.current.material as THREE.LineBasicMaterial).opacity <= 0) {
        setVisible(false);
      }
    }
  });

  if (!visible) return null;
  return <Line ref={lineRef} points={currentPoints} color={color} lineWidth={1.5} transparent opacity={animationPhase === 'fading' ? (lineRef.current?.material.opacity || 1) : 1} />;
};

// Sprout Component
const Sprout: React.FC<{ onAnimationComplete: () => void }> = ({ onAnimationComplete }) => {
  const groupRef = useRef<THREE.Group>(null!);
  const [scale, setScale] = useState(0.01);
  const [phase, setPhase] = useState<'growing' | 'pulsing' | 'stable'>('growing');
  useEffect(() => {
    let growingTimeout: NodeJS.Timeout;
    if (phase === 'growing') growingTimeout = setTimeout(() => setPhase('pulsing'), 1200);
    let pulsingTimeout: NodeJS.Timeout;
    if (phase === 'pulsing') pulsingTimeout = setTimeout(() => { setPhase('stable'); onAnimationComplete(); }, 1500);
    return () => { clearTimeout(growingTimeout); clearTimeout(pulsingTimeout); };
  }, [phase, onAnimationComplete]);

  useFrame((_state, delta) => {
    if (!groupRef.current) return;
    if (phase === 'growing') setScale(s => Math.min(s + 1.0 * delta, 1));
    else if (phase === 'pulsing') groupRef.current.scale.setScalar(1 + Math.sin(_state.clock.elapsedTime * 5) * 0.1);
    else if (phase === 'stable') groupRef.current.scale.setScalar(1);
    groupRef.current.scale.set(scale, scale, scale);
  });

  return (
    <group ref={groupRef} position={[0, -HILL_AMPLITUDE -5 + 0.5, 0]}>
      <mesh position={[0, 1.5, 0]}>
        <cylinderGeometry args={[0.1, 0.15, 3, 8]} />
        <meshStandardMaterial color={SPROUT_STEM_COLOR} emissive={SPROUT_STEM_COLOR} emissiveIntensity={0.3} roughness={0.7} metalness={0.1} />
      </mesh>
      {[...Array(5)].map((_, i) => (
        <mesh key={i} position={[Math.sin((i / 5) * Math.PI * 2) * (1 + (i%2)*0.3), 3 + Math.cos((i / 5) * Math.PI) * 0.5, Math.cos((i / 5) * Math.PI * 2) * (1 + (i%2)*0.3)]} rotation={[Math.random() * 0.5 - 0.25, (i / 5) * Math.PI * 2, Math.PI / 4 + (Math.random() * 0.3 - 0.15)]}>
          <planeGeometry args={[1.5, 0.8]} />
          <meshStandardMaterial color={SPROUT_LEAF_COLOR} emissive={SPROUT_LEAF_COLOR} emissiveIntensity={0.4} side={THREE.DoubleSide} roughness={0.6} metalness={0.1}/>
        </mesh>
      ))}
      <pointLight color={SPROUT_GLOW_COLOR} intensity={phase === 'pulsing' ? 30 : 15} distance={10} decay={2} position={[0,2,0]}/>
    </group>
  );
};

// Main Scene Logic for R3F
const SceneContent: React.FC = () => {
  const { camera } = useThree();
  const [animationPhase, setAnimationPhase] = useState<'initial' | 'tracing' | 'converging' | 'blossoming' | 'stable'>('initial');
  const [showSprout, setShowSprout] = useState(false);
  const [showTagline, setShowTagline] = useState(false);

  const streams = useMemo(() => Array.from({ length: NUM_DATA_STREAMS }).map((_, i) => {
    const angle = (i / NUM_DATA_STREAMS) * Math.PI * 2;
    const radius = LANDSCAPE_WIDTH / 2.5 + (Math.random() - 0.5) * 20;
    const startX = Math.cos(angle) * radius;
    const startZ = Math.sin(angle) * radius;
    const startY = (Math.sin(startX * HILL_FREQUENCY) + Math.cos(startZ * HILL_FREQUENCY * 0.7)) * HILL_AMPLITUDE + Math.random() * 3 - 1.5 - (HILL_AMPLITUDE + 5);
    const midX = startX * 0.4 + (Math.random() - 0.5) * 30;
    const midZ = startZ * 0.4 + (Math.random() - 0.5) * 30;
    const midY = startY * 0.5 + (Math.random() * 5 - 2.5);
    return { id: `stream-${i}`, startPoint: new THREE.Vector3(startX, startY, startZ), midPoint: new THREE.Vector3(midX, midY, midZ), endPoint: new THREE.Vector3(0, - (HILL_AMPLITUDE + 5) + 1, 0), color: i % 2 === 0 ? STREAM_COLOR_CYAN : STREAM_COLOR_WHITE };
  }), []);

  useEffect(() => {
    camera.position.set(0, 25, 55);
    camera.lookAt(0, 0, 0);
    const t0 = setTimeout(() => setAnimationPhase('tracing'), 500);
    const t1 = setTimeout(() => setAnimationPhase('converging'), 4500);
    const t2 = setTimeout(() => { setAnimationPhase('blossoming'); setShowSprout(true); }, 7000);
    return () => { clearTimeout(t0); clearTimeout(t1); clearTimeout(t2);};
  }, [camera]);

  const handleSproutAnimationComplete = () => { setAnimationPhase('stable'); setTimeout(() => setShowTagline(true), 500); };

  const energyPointRef = useRef<THREE.Mesh>(null!);
  useFrame((_state, delta) => {
    if (animationPhase === 'converging' && energyPointRef.current) {
      energyPointRef.current.scale.setScalar(Math.max(0.1, energyPointRef.current.scale.x + 2 * delta));
      (energyPointRef.current.material as THREE.MeshBasicMaterial).opacity = Math.min(1, (energyPointRef.current.material as THREE.MeshBasicMaterial).opacity + 1.5 * delta);
    } else if (animationPhase === 'blossoming' && energyPointRef.current) {
      energyPointRef.current.scale.setScalar(Math.max(0, energyPointRef.current.scale.x - 5 * delta));
      (energyPointRef.current.material as THREE.MeshBasicMaterial).opacity = Math.max(0, (energyPointRef.current.material as THREE.MeshBasicMaterial).opacity - 3 * delta);
    }
  });

  return (
    <>
      <ambientLight intensity={0.3} color={LANDSCAPE_COLOR_DARK_BLUE}/>
      <directionalLight position={[30, 50, 30]} intensity={1.2} color={new THREE.Color("#AADDBB")} castShadow />
      <pointLight position={[0, 20, 0]} intensity={15} color={STREAM_COLOR_CYAN} distance={100} decay={1.5}/>
      <fog attach="fog" args={[LANDSCAPE_COLOR_DARK_BLUE, 40, 120]} />
      <color attach="background" args={[LANDSCAPE_COLOR_DARK_BLUE]} />
      <Landscape />
      {streams.map(stream => (
        <DataStream key={stream.id} {...stream} animationPhase={ animationPhase === 'tracing' ? 'tracing' : animationPhase === 'converging' ? 'converging' : (animationPhase === 'blossoming' || animationPhase === 'stable') ? 'fading' : 'tracing' }/>
      ))}
      {(animationPhase === 'converging' || animationPhase === 'blossoming') && (
        <mesh ref={energyPointRef} position={[0, -(HILL_AMPLITUDE + 5) + 1.5, 0]} scale={0.1}>
          <sphereGeometry args={[1, 16, 16]} />
          <meshBasicMaterial color={ENERGY_POINT_COLOR} transparent opacity={0} fog={false}/>
        </mesh>
      )}
      {showSprout && <Sprout onAnimationComplete={handleSproutAnimationComplete} />}
      {showTagline && (
         <Text color={STREAM_COLOR_WHITE} fontSize={1.2} maxWidth={200} lineHeight={1} letterSpacing={0.02} textAlign="center" anchorX="center" anchorY="middle" position={[0, -10, 25]} rotation={[-0.2,0,0]} font="/fonts/Inter-Regular.woff">
            FarmIT: Cultivating the Future.
        </Text>
      )}
      {/* <OrbitControls /> */}
    </>
  );
};


const ActualSophisticatedScene: React.FC = () => {
  const [isClientMounted, setIsClientMounted] = useState(false);

  useEffect(() => {
    setIsClientMounted(true);
  }, []);

  if (!isClientMounted) {
    // This fallback is shown before client-side mounting, or if R3F is not used/commented out.
    return (
      <div className="w-full h-full flex flex-col items-center justify-center bg-muted/30 p-8 text-center">
        <p className="text-lg font-semibold text-primary mb-2">3D Animation Placeholder</p>
        <p className="text-sm text-muted-foreground">
          The React Three Fiber (R3F) 3D animation is intended here.
        </p>
        <p className="text-sm text-muted-foreground mt-1">
          If you're seeing this after the page load, there might be an issue with the R3F rendering.
        </p>
      </div>
    );
  }
  
  // Attempt to render R3F Canvas only on the client
  return (
    <div className="w-full h-full">
      <Canvas
        shadows
        camera={{ position: [0, 25, 60], fov: 50, near: 0.1, far: 200 }}
        gl={{ antialias: true, alpha: false }}
      >
        <Suspense fallback={<Html center><p className="text-primary-foreground">Loading 3D Scene...</p></Html>}>
          <SceneContent />
        </Suspense>
      </Canvas>
    </div>
  );
};

export default ActualSophisticatedScene;

This scene is then dynamically imported into my homepage (src/app/page.tsx) via SophisticatedHeroAnimation.tsx which also uses dynamic import:

// In src/app/page.tsx within a HeroSection component
const SophisticatedHeroAnimation = dynamic(
  () => import('@/components/animations/SophisticatedHeroAnimation'),
  {
    ssr: false,
    loading: () => <div className="w-full h-[500px] md:h-[600px] bg-muted/30 flex items-center justify-center"><p className="text-muted-foreground">Loading Animation...</p></div>
  }
);

// SophisticatedHeroAnimation.tsx itself dynamically loads ActualSophisticatedScene.tsx:
// const ActualSophisticatedScene = dynamic(() => import('@/components/animations/ActualSophisticatedScene'), { ssr: false, /* ...loading */ });


function HeroSection() {
  // ...
  return (
    <section className="relative text-center bg-gradient-to-br from-primary/10 via-background to-background overflow-hidden">
      <div className="absolute inset-0">
        <div className="w-full h-[500px] md:h-[600px]"> {/* Ensured dimensions */}
          <SophisticatedHeroAnimation />
        </div>
      </div>
      {/* ... rest of hero content ... */}
    </section>
  );
}

Troubleshooting Steps Taken:

Verified ‘use client’;: Ensured all R3F components and their direct parents are client components.
Dependency Versions: Tried various combinations of Next.js, React, R3F (stable and alpha), Drei, and Three.js versions. Currently on the versions listed above.
Dynamic Imports: Used next/dynamic with ssr: false for the R3F scene and its direct wrapper.
Simplified Scene: Tested with a very basic R3F scene (e.g., just a spinning cube), and the error still occurs.
Client-Side Mount Check: Added useEffect with useState in ActualSophisticatedScene.tsx to ensure it only attempts to render R3F content after mounting on the client.
Direct Loading: Attempted dynamically loading the ActualSophisticatedScene.tsx directly in page.tsx to simplify the component tree.
Node Modules: Cleared node_modules and lock files (package-lock.json/pnpm-lock.yaml) and reinstalled.
Clean Next.js Cache: Deleted the .next folder.
None of these steps have resolved the ReactCurrentOwner error. The error seems to originate deep within react-reconciler when R3F attempts to create its renderer.

Question to the Community:

Has anyone encountered a similar persistent ReactCurrentOwner error with React Three Fiber specifically in a Next.js (App Router) environment, particularly when developing in a cloud-based IDE like Firebase Studio?
Are there known incompatibilities or specific configurations required for R3F within such an environment that I might be missing?
Could this be related to how Webpack or the Next.js compiler is configured/behaving in Firebase Studio?
Any suggestions for further debugging or potential workarounds?
I’m trying to create a sophisticated 3D hero animation, and this error is completely blocking progress. Any insights or help would be greatly appreciated!

Thanks in advance.

Swiper slide is not taking the full width of the carousel, even when specified as show 1 slide

I’m trying to make my slides take up on the whole swiper, its not meant to show the prev and next slides, just one since its basically a Hero.
enter image description here

This is my current code, you will notice i try to specify 1 slide per view:

'use client';
import React, { useEffect, useState } from 'react';
import { useRouter } from 'next/navigation';
import './hero.css';
import TicketSearch from '../ticket-search/ticket-search';
import { Swiper, SwiperSlide } from 'swiper/react';
import { Autoplay } from 'swiper/modules';
import 'swiper/css';
import { Button } from '@mui/material';
import ChatIcon from '@mui/icons-material/Chat';  // or ChatBubble

const heroSlides = [
   {
       alt: 'Cumpleaños infantil',
       mobileSrc: '/images/responsive-hero-img.png',
       desktopSrc: '/images/responsive-hero-img-pc.png',
   },
   {
       alt: 'Celebra tu cumpleaños',
       mobileSrc: '/images/celebrate-birthday-hero.png',
       desktopSrc: '/images/celebrate-birthday-hero.png',
   },
   {
       alt: 'Fiesta empresarial',
       mobileSrc: '/images/business-party-hero.png',
       desktopSrc: '/images/business-party-hero.png',
   },
];


function HeroSection({ desktopSrc, alt, layout }) {
   return (
       <div className="hero-wrapper">
           <img src={desktopSrc} alt={alt} className="hero-img" />
           <div className={layout}>
               <HeroButton text="Ver más" style={buttonStylesLightBlue} />
               <HeroButton text="Quiero CELEBRAR MI CUMPLEAÑOS" style={buttonStylesDarkBlue} />
           </div>
       </div>
   );
}

function HeroSlide({ mobileSrc, desktopSrc, alt, className }) {
   return (
       <picture>
           <source media="(min-width: 1024px)" srcSet={desktopSrc} />
           <img src={mobileSrc} alt={alt} className={className} />
       </picture>
   );
}

export default function Hero() {
   const [isDesktop, setIsDesktop] = useState(false);

   useEffect(() => {
       const checkIsDesktop = () => setIsDesktop(window.innerWidth >= 426);
       checkIsDesktop();
       window.addEventListener('resize', checkIsDesktop);
       return () => window.removeEventListener('resize', checkIsDesktop);
   }, []);

   return (
       <section className="hero-section">
           {isDesktop ? (
               <Swiper
                   autoplay={{ delay: 10000, disableOnInteraction: false }}
                   loop
                   freeMode={true}          
                   modules={[Autoplay]}
                   slidesPerView={1}
                   centeredSlides={false}
                   spaceBetween={0}
                   initialSlide={1} 
               >
                   <SwiperSlide>
                       <HeroSection {...heroSlides[1]} layout="button-group-birthday" />
                   
                   </SwiperSlide>
                   <SwiperSlide>
                       <HeroSection {...heroSlides[0]} layout="button-group-regular" />
                   </SwiperSlide>
                   <SwiperSlide>
                       <HeroSection {...heroSlides[2]} layout="button-group-vertical" />
                   </SwiperSlide>
               </Swiper>
           ) : (
               <HeroSlide {...heroSlides[0]} className="hero-img" />
           )}

       </section>
   );
}

This is the css:

.hero-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
}

.hero-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

.hero-section {
    width: 100vw;
    height: 50vh;
    overflow: hidden;
}

/* Buttons over the image */
.button-group-regular{
    display: flex;
    gap: 20px;
    position: absolute;
    top: 72%;
    left: 7%;
   
    z-index: 10;


}
/* Buttons over the image */
.button-group-birthday{
    display: flex;
    gap: 20px;
    position: absolute;
    top: 70%;
    left: 15%;
    z-index: 10;


}
.button-group-vertical{
    display: flex;
    flex-direction: column-reverse;
    gap: 20px;
    position: absolute;
    top: 59%;
    left: 3%;
    z-index: 10;


}


.swiper {
    width: 100%;
    height: 100%;
  }
  
.swiper-slide {

    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Make sure each slide's internal <picture> element fills full space */
.swiper-slide picture {
    display: block;
    width: 100%;
    height: 100%;
}

/* Ensure image fills its container */

/* Desktop: taller hero */
@media (min-width: 424px) {
    .hero-section {
        height: 52vh;
    }
    .hero-img{
        object-fit: fill;
    }
}
@media (min-width: 1023px) {
    .hero-section{
        height: 60vh;
    }


}
/* Desktop: taller hero */
@media (min-width: 1400px) {
/* Buttons over the image */
        .button-group-birthday{
            display: flex;
            gap: 20px;
            position: absolute;
            top: 70%;
            left: 35%;
            z-index: 10;


        }
}

you can find the complete website if you want to give it a look here

Missing chunk-size headers in chunked Transfer-Encoding stream

I have been working on a “HTTP Server from Scratch” project, and for the past few days I’ve been stuck degubbing it, to no avail. This is my generator function for chunked encoding reading:

async function*  readChunks(conn: TCPConn, buf: DynBuf): BufferGenerator {

    for(let last = false; !last;) {
        console.log("dynbuf: ", buf.data.subarray(buf.readOffset, buf.readOffset + buf.length));
        
        const idx = buf.data.subarray(buf.readOffset, buf.readOffset+ buf.length).indexOf(Buffer.from('rn'));
        if(idx < 0) {// need more data
            if (buf.length > MAX_CHUNK_SIZE) {
                throw new HTTPError(413, 'Chunk size too large');
            }
            const data = await soRead(conn);
            bufPush(data, buf);
            continue;
        }
        
        if (idx+1 > MAX_CHUNK_SIZE) {
                throw new HTTPError(413, 'Chunk size too large');
            }
        //console.log("idx:", idx, buf.data.subarray(buf.readOffset, buf.readOffset+idx));
        let remain = parseChunkHeader(buf.data.subarray(buf.readOffset, buf.readOffset+idx)); //parse chunk size
        bufPop(buf, idx+2); //remove line
        
        console.log("dynbuf after reading size: ", buf.data.subarray(buf.readOffset, buf.readOffset + buf.length))
        
        if(Number.isNaN(remain)) {
            console.log("bad chunk: ",buf.data.subarray(buf.readOffset, buf.readOffset+idx).toString())
            throw new HTTPError(400, "Bad chunk");
        }
        last = (remain === 0);
        console.log("chunk size: ", remain);
        
        while(remain) {
            if(buf.length === 0) {
                await bufExpectMore(conn, buf, 'chunk data');
            }
            
            const consume = Math.min(remain, buf.length);
            const data = buf.data.subarray(buf.readOffset, buf.readOffset + consume);
            console.log(data.toString())
            bufPop(buf, consume);
            remain-=consume;
            
            yield data;
        }
        
        console.log("dynbuf after chunk read: ", buf.data.subarray(buf.readOffset, buf.readOffset + buf.length))
        await bufExpectMore(conn, buf, 'chunk data');
        while(buf.length < 2) {
            await bufExpectMore(conn, buf, 'chunk data');
        }
        
        if(buf.data[buf.readOffset] !== 0x0D || buf.data[buf.readOffset + 1] !== 0x0A) {
            throw new HTTPError(400, 'Missing CRLF after chunk data');
        }
        
        bufPop(buf, 2);
        console.log("dynbuf after final remove: ", buf.data.subarray(buf.readOffset, buf.readOffset + buf.length))
    }
}

The function bufExpectMore() just reads the data from OS buffer (my reading logic involves pausing and resuming the socket for ‘data’ event emission).

This is the problem that I’ve been encountering: when a client sends a chunked data to the server, it’s supposed to echo the data back in chunked format. But my server is missing parts of some chunks, due to which it throws HTTPError. The client sends <Buffer 31 65 0d 0a 48 65 6c 6c 6f 20 77 6f 72 6c 64 20 77 68 61 74 20 61 72 65 20 79 6f 75 20 64 6f 69 6e 67 0d 0a> repeatedly every second.

Over to the server side, it is recieving the first chunk just fine. Here’s the server log:

dynbuf:  <Buffer >
dynbuf:  <Buffer 31 65 0d 0a 48 65 6c 6c 6f 20 77 6f 72 6c 64 20 77 68 61 74 20 61 72 65 20 79 6f 75 20 64 6f 69 6e 67 0d 0a>
dynbuf after reading size:  <Buffer 48 65 6c 6c 6f 20 77 6f 72 6c 64 20 77 68 61 74 20 61 72 65 20 79 6f 75 20 64 6f 69 6e 67 0d 0a>
chunk size:  30
Hello world what are you doing
dynbuf after chunk read:  <Buffer 0d 0a>
dynbuf after final remove:  <Buffer >
dynbuf:  <Buffer >
dynbuf:  <Buffer 0d 0a 48 65 6c 6c 6f 20 77 6f 72 6c 64 20 77 68 61 74 20 61 72 65 20 79 6f 75 20 64 6f 69 6e 67 0d 0a 00 00>

The first chunk was recieved just fine, and at the end when data was read, the trailing crlf was remvoed. But in the next iteration, when data is loaded into the DynBuf, the 31 64 is missing from the byte stream and the crlf 0d 0a is loaded into buf.

At first i assumed that bufPop() might be the culprit, but it couldn’t possibly delete the next chunk data before it has been read by the bufExpectMore().

I have found a work around this problem, by introducing await bufExpectMore(.../*omited*/) right after the chunk data is read completely.
So apparently, when the socket is read right after the first chunk is finished reading, the second chunk data arrives wholly, but when I try to do that in the next iteration of the for loop, it somehow drops the chunk size header, expect the trailing crlf.

Please help me understand the root cause of this behavior.

P.S. Here’s the DynBuf type definition:

type DynBuf  = {
    data: Buffer;
    length: number;
    readOffset: number;
}

And the DynBuf operations logic:

export function bufSize(buf:DynBuf): number {
    return buf.data.length - buf.readOffset
}

function bufCapacity(buf: DynBuf):number {
    return buf.data.length;
}

export function bufPush(data: Buffer, buf: DynBuf):void {
    const newLen = buf.length + data.length;
    
    if(newLen > bufSize(buf)) {
        //grow the buffer
        let cap = Math.max(bufSize(buf), 32);
        while(cap < newLen) {
            cap *= 2;
        }
        let grown = Buffer.alloc(cap);
        buf.data.copy(grown, 0, buf.readOffset); 
        buf.data= grown;
    }
    
    data.copy(buf.data, buf.length, 0);  
    buf.length=newLen;
}

export function bufPop(buf:DynBuf, len:number):void {
    buf.readOffset += len;
    buf.length-=len;
    if(buf.readOffset >= bufCapacity(buf)/2) {
        buf.data = Buffer.from(buf.data.subarray(buf.readOffset));
        buf.readOffset = 0;
    }
}

condition for HtmlAttributes tooltip on Kendo UI Grid

The conditional tooltip is not working on kendo UI Grid column.

The following code is not applying the If condition for title and instead showing the whole text

'#= (!IsSynced && !AddressNickname.includes('NA')) ? 'This can be updated in the details tab' : 'Edit Address' #'

Here the Code

 columns.Command(command => command.Custom("Address")
  .Click("AddressList.Address")
  .Text("<span class='fas fa-pencil-alt fa-fw'></span>")
  .HtmlAttributes(new { title = "#= (!IsSynced && !AddressNickname.includes('NA')) ? 'This can be updated in the details tab' : 'Edit Address' #" })

CSS page counters not visible in generated PDF using @page rule

I’m developing a feature to generate a PDF health report from an EJS template. I’m trying to add page numbers (e.g., “Page 1 of 10”) to the footer of each page. I’m using the CSS Paged Media Module features, specifically counter(page) and the @page rule.
While the PDF generates correctly with all the content and page breaks, the page numbers are completely missing.

Problem Description

The goal is to have a “Page X of Y” counter at the bottom of every page in the final PDF file. I have implemented this using CSS counters and the @page at-rule with a @bottom-center margin box. The rest of the report’s content and styling, including dynamic page breaks between sections, works as expected. However, the footer with the page number does not appear on any page.

As you can see CSS is being applied but some how I’m not able to see the content text

What I’ve Tried

My setup involves a Node.js backend that renders an EJS file into HTML, which is then converted into a PDF.
Here is the relevant CSS I’ve added to the section of my report.ejs file. I’ve intentionally used a large, red font to make sure the page numbers would be noticeable if they were rendering.

.report-container {
  /* Initialize the page counter */
  counter-reset: page;
}

.section-content {
  /* Increment the page counter on each new section that causes a page break */
  counter-increment: page;
}

/* Define styles for printing and PDF generation */
@page {
  @bottom-center {
    /* These properties are my attempt to style the page number */
    display: block;
    width: 100%;
    height: 100%;
    position: absolute;
    text-align: center;
    color: rgb(188, 0, 0); /* Bright red for visibility */
    font-size: 45px;       /* Very large font size for visibility */
    content: "Page " counter(page) " of " counter(pages);
    z-index: 1000;
  }
}

And this is a simplified version of my EJS/HTML structure that generates the pages. Each page-group is designed to start on a new page (except the first one).

<div class="report-container">
  <% pageGroups.forEach((group, index) => { %>
    <table class="page-table" <%- index > 0 ? 'style="page-break-before: always;"' : '' %>>
      <thead>
        <tr>
          <td class="page-header">
            <!-- Header content -->
          </td>
        </tr>
      </thead>
      <tbody>
        <tr>
          <td class="page-content">
            <div class="section-content content-area">
              <!-- Main content for the page -->
            </div>
          </td>
        </tr>
      </tbody>
      <tfoot>
        <tr>
          <td class="page-footer">
            <!-- This is empty because I'm trying to use the @page rule for the footer -->
          </td>
        </tr>
      </tfoot>
    </table>
  <% }); %>
</div>

My Questions

Is there an issue with my CSS or the way I’m incrementing counters that would cause the page numbers not to render?
I’ve read that some CSS properties like position and z-index don’t apply to page-margin boxes like @bottom-center. Could including them be breaking the rendering of the content property?
Could this be a limitation of the PDF generation library I am using in my Node.js environment? Are there known compatibility issues with counter(pages) or the @page rule in common libraries (like Puppeteer, html-pdf, etc.)?

Expected Outcome

I expect to see a page number, such as “Page 1 of 10”, rendered in large red text at the bottom-center of each page of the output PDF. Currently, there is nothing there.
Any help or insight into why my page numbers are not visible would be greatly appreciated!

Plotly Charts Not Displaying Correctly Despite Valid Data and Code

I’m facing a strange issue where none of my Plotly charts display correctly, even though the data is valid and the code runs without errors. This includes various chart types like line, bar, pie, and scatter charts.

Problem:

  • The charts do render, but the data doesn’t reflect correctly in the visuals.
  • Sometimes the charts appear blank, misaligned, or show incorrect values.
  • There are no errors in the console or traceback, which makes debugging hard.

Context:
I’m using Plotly with Flask in a web app. The charts are passed to the frontend using plotly.utils.PlotlyJSONEncoder and rendered using Plotly.newPlot() in JavaScript. Here’s an example of how I generate and pass a chart:

Python (Flask backend):

import json
import plotly.graph_objs as go
from flask import render_template

@app.route("/weather")
def weather():
    fig = go.Figure(data=go.Bar(x=["Mon", "Tue", "Wed"], y=[2, 5, 3]))
    graphJSON = json.dumps(fig, cls=plotly.utils.PlotlyJSONEncoder)
    return render_template("weather.html", graphJSON=graphJSON)

HTML (Jinja + JavaScript frontend):

<div id="plot"></div>
<script>
    var graph = {{ graphJSON | safe }};
    Plotly.newPlot("plot", graph.data, graph.layout);
</script>

What I tried:

  • Validated all x and y values are lists of the same length
  • Tried fig.to_json() instead of json.dumps()
  • Made sure graph.data and graph.layout are being accessed properly
  • Filled NaN values with 0
  • Checked for browser console errors (none found)
  • Verified Plotly is correctly loaded from CDN

What I expected:

Charts should render based on the data e.g., bar charts with correct heights, pie charts with correct slices, and heatmaps with accurate density. Instead, the visuals don’t align with the actual data, or appear empty or broken.

Expected Output (when using .show() in Python) (https://i.sstatic.net/gzRyqWIz.png)

Actual Output (on the webpage via Flask and Plotly.newPlot())(https://i.sstatic.net/KIf5eUGy.png)

Why does the order of .map(), .filter(), and .reduce() affect performance in JavaScript, in engines like V8? [closed]

In JavaScript (e.g., using the V8 engine), chaining array methods like .map(), .filter(), and .reduce() can be done in different orders.

What are the performance implications of:

array.filter(...).map(...).reduce(...)
// vs.
array.map(...).filter(...).reduce(...)

Which order is generally preferred for better performance and why?
Does the JavaScript engine (like V8) optimize this chaining in any way?

Dynamic Loading in Parcel reverts back to the index.html

I am building a SPA, using Parcel and Firebase. I am however encountering unexpected behaviour. I have established a function setDynamicRouting(), that should pull the html from different subpages (which I have save in a sections folder). The issue is that every time the the pages is requested, it loads the index.html, instead of the html from the subpages. I think this is default behaviour from Parcel. Therefore I am also not getting any errors, which makes debugging hard.

Has anyone encountered this behaviors before? And is there a solution?

// Main function to initialize navigation and dynamic loading
function setupDynamicRouting() {
  const main = document.getElementById('main-content');

  // Click handler: update hash
  document.querySelectorAll('[data-section]').forEach(link => {
    link.addEventListener('click', (e) => {
      e.preventDefault();
      const section = link.getAttribute('data-section');
      if (section) {
        window.location.hash = section; // Triggers hashchange
      }
    });
  });

  // Hash change handler: fetch and load section
  async function handleHashChange() {
    const sectionName = window.location.hash.replace(/^#/, '') || 'main-dashboard';
    const path = `./sections/${sectionName}.html?_=${Date.now()}`;

    try {
      const response = await fetch(path);
      if (!response.ok) throw new Error(`Failed to fetch ${path}`);
      const html = await response.text();
      main.innerHTML = html;
    } catch (err) {
      console.error('[loadSection] Error:', err);
      main.innerHTML = `
        <div class="alert alert-danger" role="alert">
          Could not load section: <strong>${sectionName}</strong>.
        </div>
      `;
    }
  }

  // Initial section load
  handleHashChange();

  // React to future URL changes
  window.addEventListener('hashchange', handleHashChange);
}
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
  <title>Evalu | Dashboard</title>

  <!-- Google Fonts & Icons -->
  <link href="https://fonts.googleapis.com/css2?family=Noto+Sans:wght@300;400;700&display=swap" rel="stylesheet">
  <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet" />
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/font/bootstrap-icons.css">

  <!-- Compiled CSS -->
  <link rel="stylesheet" href="css/style.css" />
</head>
<body class="bg-light text-dark">

  <!-- Navbar -->
  <nav class="navbar navbar-expand-lg navbar-dark bg-primary">
    <div class="container-fluid">
      <a class="navbar-brand" href="#">
        <img src="/public/imgs/evalu-logo.png" alt="Evalu Logo" height="40" />
      </a>
      <div class="d-flex">
        <button class="btn btn-outline-light" type="button">
          <i class="material-icons">account_circle</i> Profile
        </button>
      </div>
    </div>
  </nav>

  <!-- Sidebar and Main Content -->
  <div class="d-flex" style="min-height: 100vh;">
    <!-- Sidebar -->
    <div class="d-flex flex-column flex-shrink-0 p-3 bg-body-tertiary" style="width: 280px;" id="sidebar">
      <a href="/" class="d-flex align-items-center mb-3 mb-md-0 me-md-auto text-decoration-none">
        <i class="bi bi-bootstrap-fill me-2" style="font-size: 1.5rem;"></i>
        <span class="fs-4">Sidebar</span>
      </a>
      <hr />

      <ul class="nav nav-pills flex-column mb-auto">
        <!-- Dashboard -->
        <li>
          <a class="nav-link link-body-emphasis" data-bs-toggle="collapse" href="#dashboardMenu" role="button" aria-expanded="false">
            <i class="bi bi-speedometer2 me-2"></i> Dashboard
          </a>
          <div class="collapse ps-4" id="dashboardMenu">
            <ul class="btn-toggle-nav list-unstyled fw-normal pb-1 small">
              <li><a href="#main-dashboard" class="nav-link link-body-emphasis" data-section="main-dashboard">Main Dashboard</a></li>
              <li><a href="#course-dashboard" class="nav-link link-body-emphasis" data-section="course-dashboard">Course Dashboard</a></li>
              <li><a href="#instructor-dashboard" class="nav-link link-body-emphasis" data-section="instructor-dashboard">Instructor Dashboard</a></li>
            </ul>
          </div>
        </li>

        <!-- Courses -->
        <li>
          <a class="nav-link link-body-emphasis" data-bs-toggle="collapse" href="#coursesMenu" role="button" aria-expanded="false">
            <i class="bi bi-journal-bookmark me-2"></i> Courses
          </a>
          <div class="collapse ps-4" id="coursesMenu">
            <ul class="btn-toggle-nav list-unstyled fw-normal pb-1 small">
              <li><a href="#courses" class="nav-link link-body-emphasis" data-section="courses">All Courses</a></li>
              <li><a href="#new-course" class="nav-link link-body-emphasis" data-section="new-course">New Course</a></li>
            </ul>
          </div>
        </li>

        <!-- Instructors -->
        <li>
          <a class="nav-link link-body-emphasis" data-bs-toggle="collapse" href="#instructorsMenu" role="button" aria-expanded="false">
            <i class="bi bi-people-fill me-2"></i> Instructors
          </a>
          <div class="collapse ps-4" id="instructorsMenu">
            <ul class="btn-toggle-nav list-unstyled fw-normal pb-1 small">
              <li><a href="#instructors" class="nav-link link-body-emphasis" data-section="instructors">All Instructors</a></li>
              <li><a href="#new-instructor" class="nav-link link-body-emphasis" data-section="new-instructor">New Instructor</a></li>
            </ul>
          </div>
        </li>
      </ul>

      <hr />

      <!-- User Dropdown -->
      <div class="dropdown">
        <a href="#" class="d-flex align-items-center text-decoration-none dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false">
          <img src="https://github.com/mdo.png" alt="User" width="32" height="32" class="rounded-circle me-2">
          <strong id="user-first-name">mdo</strong>
        </a>
        <ul class="dropdown-menu text-small shadow">
          <li><a class="dropdown-item" href="#">New project...</a></li>
          <li><a class="dropdown-item" href="#">Settings</a></li>
          <li><a class="dropdown-item" href="#">Profile</a></li>
          <li><hr class="dropdown-divider"></li>
          <li><a class="dropdown-item" href="#">Sign out</a></li>
        </ul>
      </div>
    </div>

    <!-- Main Content Area -->
    <main class="flex-grow-1 p-4" id="main-content">
      <!-- Loaded content will go here -->
    </main>
  </div>

  <!-- JS -->
  <script type="module" src="js/dashboard.js"></script>
</body>
</html>

How do I get all the attributes of an SVG path

I am trying to get attribute values of an SVG <path> element. I have the SVG file data as a string. I am currently using code similar to this to load the SVG data as an XML document which I can then query:

const parser = new DOMParser();
const doc = parser.parseFromString(data, "application/xml");
const elements = doc.getElementsByTagName("path");

Now I can use the attributes collection on the element to get the list of attributes. This works for some SVG files, but for others, some of the attributes are inherited, either from the <g> element, from the <svg> element, or maybe defined as a CSS style.

Is it possible to get all the attribute values including those that are inherited?