NextAuth 404 not found route on sign in to google provider

/auth/[...nextauth]/route.ts path

i am trying to set auth for my website, specifically using google provider, however whenever i sign in in the admin page, it redirect me to some non existing route, the code is below, I am not sure how to debug such problem considering that I can’t find any source/log of errors for nextauth and it is not appearing on server side.

import NextAuth from "next-auth";
import GoogleProvider from "next-auth/providers/google";

// Define your NextAuth options
const authOptions = {
  // Configure one or more authentication providers
  providers: [
    GoogleProvider({
      clientId: process.env.GOOGLE_CLIENT_ID!,
      clientSecret: process.env.GOOGLE_API_SECRET!,
      authorization: {
        params: {
          prompt: "consent",
          access_type: "offline",
          response_type: "code",
        },
      },
    }),
  ],
  // ...add more providers here
};

// Create the NextAuth handler
const handler = NextAuth(authOptions);

// Export the handler for both GET and POST requests
export const GET = handler;
export const POST = handler;


layout.ts:

import type { Metadata } from "next";
import localFont from "next/font/local";
import "./globals.css";
import { NextSessionProvider } from "./[admin]/page";


const geistSans = localFont({
  src: "./fonts/GeistVF.woff",
  variable: "--font-geist-sans",
  weight: "100 900",
});
const geistMono = localFont({
  src: "./fonts/GeistMonoVF.woff",
  variable: "--font-geist-mono",
  weight: "100 900",
});

export const metadata: Metadata = {
  title: "Create Next App",
  description: "Generated by create next app",
};

export default function RootLayout({
  children,
}: Readonly<{
  children: React.ReactNode;
}>) {
  return (
    <html lang="en">
      <body
        className={`${geistSans.variable} ${geistMono.variable} antialiased overflow-x-hidden`}
      >
        <NextSessionProvider>
        {children}
        </NextSessionProvider>
      </body>
    </html>
  );
}
``` whenever i try to sign in to the provider (aka google), i get an error 404 shown on screenshot
why and how to debug?


[![enter image description here][1]][1]


  [1]: https://i.sstatic.net/O9YArBI1.png

macOS The subscription was successful with @abandonware/noble, but the notify data is not being received

async function cubeNotify(characteristic) {
    console.log(`notifyID:${characteristic.uuid}`);

    await characteristic.subscribe((error) => {
        if (error) {
            console.error(`subscribe fail: ${error}`);
        } else {
            console.log('subscribe success');
        }
    });

    characteristic.on('data', (data) => {
        if (data.length === 0) {
            return;
        }
        console.log(data);
    });
}

This code works fine on Windows. It doesn’t work on MacOS. The subscription success message is printed. But no data is received. What did I miss?. I need help.

I am using macOS 15.
I have checked the device, and everything seems fine.
I tried setting macOS Bluetooth permissions, but it didn’t help.
I also tried using notify instead of subscribe.
I tried using on read instead of on data.
When using the LightBlue app, the device’s data is received correctly.
Is this an issue with Noble?

Notifications not showing up as banner, only in toolbar (android PWA)

I am making a PWA and got to a point where I hear notifications and when I slide down, I can see the notification with title and body, but I wish it showed up on the screen as well, in the case where I am using my phone. Right now in this case the notification just makes a sound and I have to slide down from the top of the screen to see it. It does not show up as normal notifications do.

self.addEventListener("push", (event) => {
  const data = event.data.json(); // Assuming the server sends JSON
  const options = {
    body: data.body,
    icon: "icon.png",
    badge: "icon.png",
  };
  event.waitUntil(self.registration.showNotification(data.title, options));
});

  const handleRequestPermission = async () => {
    navigator.serviceWorker
      .register("/service-worker.js")
      .then(async (registration) => {
        const permission = await Notification.requestPermission();

        if (permission === "granted") {
          // Subscribe to push notifications
          const subscription = await registration.pushManager.subscribe({
            userVisibleOnly: true, // does not help
            applicationServerKey: import.meta.env.VITE_VAPID_PUBLIC_KEY,
          });

          // Send subscription to backend to save it
          await api.post("/api/client/push/subscribe", {
            subscription,
          });
        } else {
          console.error("Permission for notifications denied");
        }
      })
      .catch((error) => {
        console.error("Service Worker registration failed:", error);
      });
    
    setIsNotifDialogOpen(false);
  };

When setting [[Prototype]] to a function in different ways, why are the results different?

  • in Microsoft Edge v131.0.2903.70 (V8 v13.1.20.6):

    •  

      { __proto__: a => console.log(a) }(1)
      

      printed 1;

    • while

      const f = {}
      f.__proto__ = a => console.log(a)
      f(1)
      

      threw TypeError: f is not a function.

  • in Node.js v23.2.0:

    • the preview of result of

      { __proto__: a => console.log(a) }(1)
      

      is fine:

    • However, when I pressed Enter:

      got TypeError: {(intermediate value)} is not a function:

How to wait until an HTML Element does Not Exist?

I’m working in ReactJS. What is the best way to find out when an element has been removed, and does not exist? I prefer to use latest MutationObserverAPI , unless ReactJs has library function to handle this. I can select the Element by Id # attribute.

https://stackoverflow.com/a/61511955/15435022

This is reference code to see when Element does not exist.

function waitForElm(selector) {
    return new Promise(resolve => {
        if (document.querySelector(selector)) {
            return resolve(document.querySelector(selector));
        }

        const observer = new MutationObserver(mutations => {
            if (document.querySelector(selector)) {
                observer.disconnect();
                resolve(document.querySelector(selector));
            }
        });

        // If you get "parameter 1 is not of type 'Node'" error, see https://stackoverflow.com/a/77855838/492336
        observer.observe(document.body, {
            childList: true,
            subtree: true
        });
    });
}

Exception: Those columns are out of bounds. – For-loops stops unexpected

So i got this code implemented in a bigger function. Basically it searches for hidden columns to hide them in a new formed sheet that will be exported as a pdf. What happens is that at every hidden column above 30 it just stops, when columnHidden is true. Under that it just works fine.

The last to line of the logger and the error:

Info start column: 33, left: 58 , Ende: 85 , Checking column: 33, isHidden: false
Error Exception: Those columns are out of bounds.

So they cant be out of bounds, cause it is right in the middle of it.

const startColumn = range.getColumn();  // The starting column of the range (e.g., "E" -> 5)
const numColumns = range.getNumColumns();  // The number of columns in the range

for (let i = 0; i < numColumns; i++) {
  const originalColumn = startColumn + i;  // Get the original column number
  const columnHidden = sheet.isColumnHiddenByUser(originalColumn);  // Check if the column is hidden in the original sheet
  const ende = tempSheet.getLastColumn();
  
  // If the column is hidden in the original sheet, hide the corresponding column in the temporary sheet
  if (columnHidden) {
    tempSheet.hideColumns(i+1);  // Hide the corresponding column in the temporary sheet
  }
  Logger.log(`start column: ${startColumn + i}, left: ${numColumns-i} , Ende: ${ende} , Checking column: ${originalColumn}, isHidden: ${columnHidden}`) ;
}

I searched for merged cells, changed the index, copy pasted. Googled it, but its not a common issue. Asked chatgpt, made a test function to see if HideColumns has a Problem with numbers above 30(it does not)…

TypeError: functions.database.ref is not a function at Object

I’m trying to deploy my project using Firebase Functions, and encountered this error:

TypeError: functions.database.ref is not a function at Object.

(C:\Users\minse\Downloads\spj\spj14 - 복사본 - 복사본 (2)\functions\index.js:132:51)

I saw this error and tried to change that line:

exports.onReportStatusChange = functions.database.ref('/reports/{reportId}')

to:

export.onReportStatusChange = functions.database().ref('/reports/{reportId}')

but it still fails.

I’m not sure what the problem is.

OneSignal service worker installing issue with GitHub Pages

Simply script tryes to get script from my GitHub Page root, I think I set up OneSignal good.

How to fix it?
Maybe there is a way to set “default” path for OneSignalSDK.sw.js?

Error:

[Service Worker Installation] Installing service worker failed TypeError: ServiceWorker script at
https://mandi-os.github.io/webdevelop.guide/OneSignalSDK.js?appId=777-777-777-777-777&sdkVersion=160204
for scope https://mandi-os.github.io/webdevelop.guide/ encountered an error during installation. [ServiceWorkerManager.js:294:12]

GET https://mandi-os.github.io/OneSignalSDK.sw.js? // <-- HERE
appId=777-777-777-777-777&sdkVersion=160204    [HTTP/2 404  9917ms]

Uncaught (in promise) Se: Registration of a Service Worker failed.

Code:

<!-- Push notifications service worker -->
<script src="https://cdn.onesignal.com/sdks/web/v16/OneSignalSDK.page.js" defer></script>
<script>
  window.OneSignalDeferred = window.OneSignalDeferred || [];
  OneSignalDeferred.push(async function(OneSignal) {
    await OneSignal.init({
      appId: "777-777-777-777-777",
    });
  });
</script>

CSS Animation to go only forward and stop. Currently it goes back and froth

I am trying to make this work so that only one pseudo-element shows “progress” if the item is highlighted (i.e., has the highlighted class).

Currently, the animation moves forward correctly, but once it reaches the end, the animation reverses.

Each item should be highlighted for 8 seconds, during which the progress bar should fill from top to bottom. Afterward, the highlight should move to the next item. This behavior should loop through all items continuously.

const items = document.querySelectorAll('.enhanced-content__animated-list-item');
  let index = 0;
  const totalItems = items.length;

  const highlightItem = () => {
    // Remove 'highlight' and 'progress' classes from all items
    items.forEach(item => {
      item.classList.remove('highlight', 'progress');
    });

    // Get the current item
    const currentItem = items[index];

    // Add 'highlight' and 'progress' classes to the current item
    currentItem.classList.add('highlight', 'progress');

    // After 8 seconds, move to the next item
    setTimeout(() => {
      index = (index + 1) % totalItems;
      highlightItem();
    }, 8000);
  };

  // Start the cycle
  highlightItem();
.enhanced-content__container {
    background: #fff; /* Replace $COLOR_BACKGROUND_WHITE */
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    left: 24px; /* Replace $SPACING_L */
    padding-block: 24px; /* Replace $SPACING_L */
    padding-inline: 24px; /* Replace $SPACING_L */
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 60%;
    margin-top: 5rem;
  }

  .enhanced-content__animated-list-item {
    flex-direction: column;
    margin-bottom: 20px;
    padding: 1rem;
    position: relative;
    text-align: left;
  }

  .enhanced-content__animated-list-item .enhanced-content__animated-list-heading,
  .enhanced-content__animated-list-item .enhanced-content__animated-list-text {
    color: #e4e4e4;
  }

  .enhanced-content__animated-list-item.highlight .enhanced-content__animated-list-heading,
  .enhanced-content__animated-list-item.highlight .enhanced-content__animated-list-text {
    color: black;
  }

  .enhanced-content__animated-list-item::before {
    background-color: #e4e4e4;
    content: '';
    height: calc(100% - 20px);
    left: 0;
    margin-top: 10px;
    position: absolute;
    top: 0;
    width: 1.5px;
  }

  .enhanced-content__animated-list-item::after {
    background-color: #007bff;
    content: '';
    height: 0;
    left: 0;
    position: absolute;
    top: 0;
    transition: height 8s linear;
    width: 1.5px;
  }

  .enhanced-content__animated-list-item.progress::after {
    height: calc(100% - 20px);
  }
}
<div class="enhanced-content">
  <div class="enhanced-content__container container">
    <h2 class="h5">heading</h2>

    <!-- Content for Desktop -->
    <div class="enhanced-content__desktop">
      <div class="enhanced-content__animated-list">
          <div class="enhanced-content__animated-list-item">
            <h3 class="enhanced-content__animated-list-heading h5">
              title 1
            </h3>
            <p class="enhanced-content__animated-list-text body-1">
            content one
            </p>
          </div>
          <div class="enhanced-content__animated-list-item">
            <h3 class="enhanced-content__animated-list-heading h5">
              title 2
            </h3>
            <p class="enhanced-content__animated-list-text body-1">
            content two
            </p>
          </div>
          <div class="enhanced-content__animated-list-item">
            <h3 class="enhanced-content__animated-list-heading h5">
              title 3
            </h3>
            <p class="enhanced-content__animated-list-text body-1">
            content three
            </p>
          </div>
          <div class="enhanced-content__animated-list-item">
            <h3 class="enhanced-content__animated-list-heading h5">
              title 4
            </h3>
            <p class="enhanced-content__animated-list-text body-1">
            content four
            </p>
          </div>
      </div>
    </div>
    </div>
  </div>

Does anyone know how i keep keep my drop down menus open when the button is clicked?

I’m in the middle of learning JS so I’m new to it and self-learning. When i click the dropdown buttons my buttons dont stay active and open for half a second and close again. would anybody be able to walk me through how i can keep them open with JS? Here is my code so far! would appreciate the help! I didn’t know a project by the way so that’s why its on Elon musk lol.

let menu_icons = document.querySelector('.menu-icons'),
nav = document.querySelector('nav');

menu_icons.addEventListener('click', () => {
    nav.classList.toggle('active');
});
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

#fullscreen-video-container {
    position: absolute;
    top: 0;
    left: 0;
    scale: 100%;
    overflow: hidden;
    z-index: -10;
  }
  
  #fullscreen-video-container video {
    object-fit: cover;
    width: 100%;
    height: 100%;
  }

img {
    top: 5px;
    position: relative; 
    height: 200px;
    width: 200px;
    
  }
:root {
    --main-color: rgb(228, 145, 37);
}

html {
    font-size: 10px;
}

body {
   
    background-attachment: fixed;
    background-size: cover;
    background-repeat: no-repeat;
    min-height: 100vh;
    overflow-x: hidden;    
}

body::before {
    position: absolute;
    min-height: 100vh;
    content: '';
    width: 100%;
 
}

a {
    text-decoration: none;
}

ul {
    list-style: none;
}

header {
    width: 100%;
    position: absolute;
    top: 0;
    left: 0;
}

.container {
    width: 100%;
    margin: 0 auto;
}

.menu-icons {
    display: none;
    align-items: center;
    justify-content: center;
    color: #eee;
    font-size: 2rem;
    position: absolute;
    top: 50%;
    right: 2rem;
    transform: translateY(-50%);
    -webkit-transform: translateY(-50%);
    -moz-transform: translateY(-50%);
    -ms-transform: translateY(-50%);
    -o-transform: translateY(-50%);
    cursor: pointer;
    z-index: 1500;
    /* display: none; */
}

nav {
    width: 100%;
    border-radius: 1px solid rgba(255, 255, 255, 0.1);
    -webkit-border-radius: 1px solid rgba(255, 255, 255, 0.1);
    -moz-border-radius: 1px solid rgba(255, 255, 255, 0.1);
    -ms-border-radius: 1px solid rgba(255, 255, 255, 0.1);
    -o-border-radius: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    height: 60px;
   
    justify-content: center;
    gap: 2rem;
}


.nav-list {
    display: flex;
    align-items: center;
}

.nav-list li {
    line-height: 8rem;
    position: relative
}

.sub-menu li {
    line-height: 4rem;
}

.nav-list a {
    display: block;
    color: #eee;
    padding: 0 1.5rem;
    font-size: 1.4rem;
    text-transform: uppercase;
    transition: color 650ms;
    -webkit-transition: color 650ms;
    -moz-transition: color 650ms;
    -ms-transition: color 650ms;
    -o-transition: color 650ms;
    position: relative;
    width: 100%;
    align-items: center;
    top: 15px;
    margin-left: 50px;
    
}

.nav-list a:active {
    color: var(--main-color);
}

.btn {
    padding: 1.3rem;
    display: inline-block;
    border: 2px solid var(--main-color);
    border-radius: 0.5rem;
    -webkit-border-radius: 0.5rem;
    -moz-border-radius: 0.5rem;
    -ms-border-radius: 0.5rem;
    -o-border-radius: 0.5rem;
    transition: background-color 650ms;
    -webkit-transition: background-color 650ms;
    -moz-transition: background-color 650ms;
    -ms-transition: background-color 650ms;
    -o-transition: background-color 650ms;
}

.btn:active {
    color: var(--main-color);
}

.sub-menu {
    width: 20rem;
    display: block;
    position: absolute;
    border-top: 3px solid var(--main-color);
    background-color: #ff2222;
    z-index: 100;
    top: 16rem;
    transition: all 250ms ease;
    -webkit-transition: all 250ms ease;
    -moz-transition: all 250ms ease;
    -ms-transition: all 250ms ease;
    -o-transition: all 250ms ease;
    opacity: 0;
    visibility: hidden;
}

.sub-menu::before {
    content: '';
    position: absolute;
    top: -2.5rem;
    left: 3rem;
    border: 1.2rem solid transparent;
    border-bottom: 1.2rem solid var(--main-color);
}

.sub-menu .sub-menu::before {
    top: .9rem;
    left: -2.5rem;
    border: 1.2rem solid transparent;
    border-right-color: var(--main-color);
}

.sub-menu .sub-menu {
    border-top: none;
    border-left: 3px solid var(--main-color);
    top: 0;
    left: 160%;
}


.nav-list li:active>.sub-menu {
    top: 8rem;
    opacity: 1;
    visibility: visible;
}

.sub-menu li:active>.sub-menu {
    top: 0;
    left: 100%;
}

li.move-right {
    margin: auto 0 auto auto;
    line-height: initial;
}

@media screen  and (max-width: 900px) {
    .nav-list {
        position: fixed;
        top: 0;
        height: 100vh;
        flex-direction: column;
        background-color: #191919;
        z-index: 1000;
        align-items: initial;
        display: none;
        overflow-y: scroll;
        width: 50%;
        right: 0;
    }

    .nav-list > li {
        line-height: 6rem;
    }

    .sub-menu {
        position: initial;
        border: 3px solid transparent;
        margin-left: 1rem;
        max-height: 0;
        background: rgba(0, 0, 0, 0.5);
        overflow: hidden;
        margin-right: 0.4rem;
        padding-right: 1rem;
    }

    .sub-menu .sub-menu {
        border: none;
        overflow: hidden;
        margin-right: 0.4rem;
    }

    .sub-menu::before {
        display: none;
    }

    .nav-list li:active > .sub-menu {
        opacity: 1;
        visibility: visible;
        max-height: initial;
    }

    li.move-right {
        margin: 0 auto 0 0;
        line-height: initial;
    }

    .menu-icons {
        display: block;
    }

    .fa-times {
        display: none;
    }

    nav.active .fa-times {
        display: block;
    }

    nav.active .fa-bars {
        display: none;
    }
    
    nav.active .nav-list {
        display: flex;
    }
}
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.14.0/css/all.min.css">
    <link rel="stylesheet" href="{{ url_for('static', filename='CSS/test.css') }}">
    <title>Document</title>
</head>
<body>
    <header>
        <div class="container">
            <nav>
                <div class="menu-icons">
                   <i class="fas fa-bars"></i>
                   <i class="fas fa-times"></i>
                </div>

                <a href="#" class="logo"><img class="logo" src="{{ url_for('static', filename='Images/logo2.png') }}"></a>

                <ul class="nav-list">
                    <li>
                        <a href="#">Home</a>
                    </li>

                    
                  <li>
                    <a href="#">ELON MUSK</a>
                </li>
                <li>
                  <a href="#">THROUGH TIME</a>
              </li>

                    <li>
                        <a href="#">ELON ODYSSEY <i class="fas fa-caret-down"></i></a>
                        <ul class="sub-menu">
                            <li>
                                <a href="#">SPACE X</a>
                            </li>

                            <li>
                              <a href="#">NEUROLINK</a>
                          </li>
                          <li>
                            <a href="#">TESLA</a>
                          </li>
                          
                        </ul>

                    </li>

                   
                    <li>
                        <a href="#">MORE
                            <i class="fas fa-caret-down"></i>
                        </a>
                        <ul class="sub-menu">
                            <li>
                                <a href="#">DOGE</a>
                            </li>
                            <li>
                              <a href="#">FORUMS</a>
                          </li>
                          <li>
                            <a href="#">BLOGS</a>
                          </li>
                        </ul>
                    </li>
                    
                    
  
                </ul>
                
            </nav>
        </div>
    </header>

    <div id="fullscreen-video-container">
      <video autoplay loop muted>
          <source src="{{ url_for('static', filename='/Videos/Background.mp4') }}">
      </video>
  </div>

      
    <script src="{{ url_for('static', filename='js/test.js') }}"></script>
</body>
</html>

Issue With JavaScript “change” not picking up a drop down menu selection

I am populating a dropdown menu and when the user selects a choice from the menu I want a function(pullWeights) to happen. I cannot figure out where my error is, I have added an echo statement to error check and my code isnt making it into the addEventListener section where the echo command is. Im sorry in advance if I asked this incorrectly, its been a long time since I have used StackOverflow. Here is the code where my problem is happening:

    <label for="licensetag">Choose A Reptile ID:</label>
    <select name="license" id="license">
        <?php foreach ($ReptileID as $ReptileID): ?>
            <option value="<?php echo $ReptileID; ?>">
                <?php echo $ReptileID; ?>
            </option>
        <?php endforeach; ?>
    </select>
    <script>
    const dropdown = document.getElementById("license");
    dropdown.addEventListener("change", function() {
        const selectedValue = dropdown.value;
        console.log("Selected value:", selectedValue);
        <?php echo "selectedValue"; ?>
        // Do something with the selected value, e.g., pass it to a function
        pullWeights(selectedValue);
    });
    </script>

Hardhat test Error. “TypeError: (0 , ethers_1.getAddress) is not a function”

I am using Hardhat to unit test a Solidity smart contract in Sepolia Network.When I try to test my contract, I get this error: “TypeError: (0 , ethers_1.getAddress) is not a function”. I think there is dependency conflict between diferent versions of ethers, hardhat and maybe @nomicfoundation/hardhat-toolbox. I have tried to change the dependency versions but the Error persists.
In this case I am trying to test that owner is set correctly at contract deployment. It is basically testing the following line in the Faucet.sol constructor:
“owner = payable(msg.sender)”.
I want to test it with my Sepolia account, so I used “ethers.providers.JsonRpcProvider” to get my account. This was possible with “ethers”: “^5.7.2”.

Faucet.sol:

// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;

contract Faucet {
  address payable public owner;

  constructor() payable {
    owner = payable(msg.sender);
  }
  
  function withdraw(uint _amount) payable public {
    // users can only withdraw .1 ETH at a time, feel free to change this!
    require(_amount <= 100000000000000000);
    (bool sent, ) = payable(msg.sender).call{value: _amount}("");
    require(sent, "Failed to send Ether");
  }

  function withdrawAll() onlyOwner public {
    (bool sent, ) = owner.call{value: address(this).balance}("");
    require(sent, "Failed to send Ether");
  }

  function destroyFaucet() onlyOwner public {
    selfdestruct(owner);
  }

  modifier onlyOwner() {
    require(msg.sender == owner);
    _;
  }
}

faucetTests.js

const { loadFixture } = require('@nomicfoundation/hardhat-network-helpers');
const { expect } = require('chai');
const { ethers } = require('hardhat');
require('dotenv').config();
require("@nomicfoundation/hardhat-toolbox");


describe('Faucet', function () {
  
  async function deployContractAndSetVariables() {
  
   const url = process.env.RPC_URL;
   let privateKey = process.env.PRIVATE_KEY;
   const provider = new ethers.providers.JsonRpcProvider(url);
   let wallet = new ethers.Wallet(privateKey, provider);
   console.log('Signer 1 address: ', wallet.address);
  
  const Faucet = await ethers.getContractFactory('Faucet');
  const faucet = await Faucet.deploy();
  await faucet.deployed();
  return { wallet, faucet };
  }

  it('should deploy and set the owner correctly', async function () {
    const { wallet, faucet } = await loadFixture(deployContractAndSetVariables);

    expect(await faucet.owner()).to.equal(wallet.address);
  });
});

hardhat.config.js

 require("@nomicfoundation/hardhat-toolbox");
require('dotenv').config()

/** @type import('hardhat/config').HardhatUserConfig */
module.exports = {
  solidity: "0.8.17",

  networks: {
    sepolia: {
      url: process.env.RPC_URL,
      accounts: [process.env.PRIVATE_KEY]
    },
  },
  etherscan: {
    apiKey: {
      sepolia: process.env.ETHERSCAN_API_KEY,
    },
  },
};

package.json

{
  "name": "how-to-unit-test-a-smart-contract",
  "version": "1.0.0",
  "main": "index.js",
  "scripts": {
    "test": "echo "Error: no test specified" && exit 1"
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "description": "",
  "devDependencies": {
    "@nomicfoundation/hardhat-toolbox": "^3.0.0",
    "@nomiclabs/hardhat-ethers": "npm:hardhat-deploy-ethers@^0.4.2",
    "ethers": "^5.7.2",
    "hardhat": "^2.22.16"
  },
  "dependencies": {
    "chai": "^4.3.7",
    "dotenv": "^16.4.5",
    "web3modal": "^1.9.12"
  }
}

Display real-time element from one page to another in same domain using Jquery load

I’m looking for a solution that can extract an element from one of our pages (on same domain) that constantly updates to a new page.

One constraint is the back end web-server that is displaying the element we want is locked to exactly what is displayed, labeled Origin Server. We want to make a more customized page using some of the same elements.

Origin Server (with elements we want to extract): https://proxy.livemadisonalerts.com/

New Page (where we want to display elements):https://livemadisonalerts.com/?page_id=50

We’ve been trying to use Jquery Load functionality and originally ran into cross site scripting issues so we ran a proxy that allows all to operate under the same domain name.

This is the code we’ve been messing with.

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" type="text/javascript"></script>

<b>test div</b>
<div id="testx"></div>

<script>
$( "#testx" ).load( "https://proxy.livemadisonalerts.com #scannercontainer" );
</script>

I guess the biggest question I have is if this is the best route to go for this situation. We can use iframe but that seems messy.

Due to insufficient memory, it was not possible to complete the previous operation problem

Let’s go, I have a site that creates a link for the user, the user opens this link on the cell phone (because I created methods so that the page only opens in mobile mode) on the cell phone he needs to open the camera to take a picture of his vehicle, but when I open the camera and take a picture I come across this error (information) ‘Due to insufficient memory, it was not possible to complete the previous operation problem’ this error (information) is in all browsers I have already tried to compress my code to base64 and I have already used packages such as image compressor (however as I use AI to check the photo I cannot use these compressors because of the quality of the image).
Is there any alternative to escape this error (information)?

My code for reading the image and transforming it into base64:

async readURL(input: any) {
  if (input.target.files && input.target.files[0]) {
    const file = input.target.files[0];
    const timeStampNow = Date.now();

    if (this.laudo?.validacaoCamera) {
      if (file.lastModified < timeStampNow - 5000) {
        this.bloquearBotaoDeCamera = true;
        return;
      }
    }

    if (file) {
      const reader = new FileReader();
      try {
        reader.onload = async (e: any) => {
          const buffer = e.target.result as ArrayBuffer;
          const Data = ExifParserFactory.create(buffer).parse();

          if (Data.tags?.GPSLatitude === undefined || Data.tags?.GPSLongitude === undefined) {
            this.geolocalizacaoService.geolocalizacao$.subscribe((geolocation) => {
              this.geolocalizacaoDaFoto = geolocation;
            });
          } else {
            const geolocation: IGeolocalizacao | null = {
              latitude: Data.tags?.GPSLatitude,
              longitude: Data.tags?.GPSLongitude,
            };

            this.geolocalizacaoDaFoto = geolocation;
          }

          this.geolocalizacaoCapturada.emit(this.geolocalizacaoDaFoto);
          this.fotoArquivo = file;

          this.fotoArquivoBase64 = await this.getBase64(file);

          this.fotoCapturada.emit(this.fotoArquivoBase64);
          this.arquivoFoto.emit(this.fotoArquivo!);

          if (!this.geolocalizacaoDaFoto) {
            this.snackbarService.mostrarErro("Não foi possível capturar a geolocalização");
            return;
          }

          if (!this.fotoArquivo) {
            this.snackbarService.mostrarErro("Não foi possível capturar a foto");
            return;
          }

          const foto: IFoto = {
            geolocalizacao: this.geolocalizacaoDaFoto,
            arquivo: this.fotoArquivo,
          };

          this.onCapturaFoto.emit(foto);
          this.chRef.detectChanges();
        };
      } catch (error) {
        // Tratar erro
      }
      reader.readAsArrayBuffer(file);
    }
  }
}

async getBase64(file: File) {
  return new Promise((resolve, reject) => {
    const reader = new FileReader();
    reader.readAsDataURL(file);
    reader.onload = () => resolve({ foto: reader.result });
    reader.onerror = (error) => reject(error);
  }).then((result: any) => {
    return result.foto;
  });
}


What is the meaning of Javascript Curly braces around mulitple variables [duplicate]

What is the meaning of Javascript Curly braces around mulitple variables? For example, what is { setRows, setRowModesModel } in toolbar: { setRows, setRowModesModel }? Is it an object?

<DataGrid
    rows={rows}
    columns={columns}
    editMode="row"
    rowModesModel={rowModesModel}
    onRowModesModelChange={handleRowModesModelChange}
    onRowEditStop={handleRowEditStop}
    processRowUpdate={processRowUpdate}
    slots={{ toolbar: EditToolbar }}
    slotProps={{
      toolbar: { setRows, setRowModesModel },
    }}
  />