The VBA Macro function cannot return the string in Google Apps Script

I am kinda ok with the VBA but I have very less clue about the Apps Script as it uses a different coding language.

Is there a way to transform this code for the Apps Script? Here are the details of my code in VBA and what I tried in the Apps Script:

Function matchstring(input1) as String

    Dim ws As Worksheet
    Set ws = Worksheets("sheet1")
    lastrow = ws.Range("B" & ws.Rows.Count).End(xlUp).Row + 1
    row2 = ws.Range("E1").Row
    col2 = ws.Range("E1").Column
    c = False
    row3 = row2
    row1 = input1.Row
    col1 = input1.Column
    
    While c = False And row3 < lastrow

        'Check A'

        a = input1.Value
        b = ws.Cells(row3, col2).Value
        d = ws.Cells(row3, col2 - 3).Value
        e = Cells(row1, col1 - 3).Value
        i = 1
        
        'Check B'
        
        f = ws.Cells(row3, col2).Value
        g = ws.Cells(row3, col2 - 1).Value
        h = "Spain"
        
        'Check C'
        
        i = ws.Cells(row3, col2).Value
        j = ws.Cells(row3, col2 - 2).Value
        k = Cells(row1, col1 - 2).Value
        
        If InStr(1, a, b, 1) And e = d And j = k And g = h Then
            c = True
            matchstring = b
        Else
            row3 = row3 + 1
            c = False
        End If
    Wend
End Function

However, when I tried to implement this code below in the App Script, the code always returns errors:

function matchstring(input1) {
  var ws = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("sheet1");
  var lastrow = ws.getRange("B" + ws.getLastRow()).getNextDataCell(SpreadsheetApp.Direction.UP).getRow() + 1;
  var row2 = ws.getRange("E1").getRow();
  var col2 = ws.getRange("E1").getColumn();  
  var c = false;
  var row3 = row2;
  var row1 = input1.getRow;
  var col1 = input1.getColumn;
  while (!c && row3 < lastrow) {
    // Check A
    var a = input1.getA1Notation;
    var b = ws.getRange(row3, col2).getA1Notation();
    var d = ws.getRange(row3, col2 - 3).getA1Notation();
    var e = ws.getRange(row1, col1 - 3).getA1Notation();

    // Check B
    var g = ws.getRange(row3, col2 - 1).getA1Notation();
    var h = "Spain";
  
    // Check C
    var j = ws.getRange(row3, col2 - 2).getA1Notation();
    var k = ws.getRange(row1, col1 - 2).getA1Notation();
  
    if (a.indexOf(b) !== -1 && e === d && j === k && g === h) {
      c = true;
      return b;
    } else {
      row3++;
      c = false;
    }
  }
}


The first error I received is related to the input1 (input1.getRow is not a function) because I think it is not yet defined in the Apps Script, but works in the GSheet.

Then I received a second error:
Exception: The parameters (null,number) don’t match the method signature for SpreadsheetApp.Sheet.getRange. (line 15).

This code could be totally wrong because I have very less knowledge on how Apps Script works.

Thank you in advance and I am always open to give further details.

i think i have problem with style.display javascript

Ok.
I have little problem
I want a button that shares more content.
so I need hiding content that when click show more and reverse also the function by hiding.

Problem is no matter what i do… the content in more id is always displayed

i tried this

<button onclick="myFunction()">More</button>
<div class="black" id="more">
    <p>I was supercool guys.... bla bla bla bla</p>
</div>
<script>
function myFunction() {
  var x = document.getElementById('more');
  if (x.style.display == "none") {
    x.style.display = "block";
  } else {
    x.style.display = "none";
  }
}
</script>

and i tried this and no differences

<button onclick="myFunction()">More</button>
<div class="black" id="more">
    <p>I was supercool guys.... bla bla bla bla</p>
</div>
<script>
function myFunction() {
  var x = document.getElementById('more');
  if (x.style.display == "block") {
    x.style.display = "none";
  } else {
    x.style.display = "block";
  }
}
</script>

so what i am missing?

I am using HTML javascript and php

how do I have a native browser function work with `await`?

I’m working on a snippet of code which repeatedly checks if there’s a pop-up confirm box. If a pop-up confirm box appears, the code let the confirm box stay for 2 seconds and automatically clicks on the cancel button.

Here are 2 snippets of JS code.

snippet 1

The first one is the code I’m working.

function sleep() {
  return new Promise(resolve => setTimeout(resolve, 2000));
}

async function delayClick(element) {
  await sleep(); // Wait for 2 seconds
  element.click();
}

// Custom confirm function implementation
window.customConfirm = function (message) {
  console.log('Confirmation message:', message);
  return new Promise((resolve) => {
    const dialog = document.createElement('dialog');
    dialog.innerHTML = `
      <div>${message}</div>
      <button id="confirm-yes">Yes</button>
      <button id="confirm-no">No</button>
    `;
    document.body.appendChild(dialog);

    const confirmYes = dialog.querySelector('#confirm-yes');
    const confirmNo = dialog.querySelector('#confirm-no');

    confirmYes.addEventListener('click', () => {
      document.body.removeChild(dialog);
      resolve(true);
    });

    confirmNo.addEventListener('click', () => {
      document.body.removeChild(dialog);
      resolve(false);
    });
  });
};

// Override the confirm function with our custom implementation
const originalConfirm = window.confirm;
window.confirm = window.customConfirm;

// Function to set up the MutationObserver
async function setupObserver() {
  const observer = new MutationObserver((mutationsList) => {
    for (const mutation of mutationsList) {
      for (const node of mutation.addedNodes) {
        if (node.nodeType === Node.ELEMENT_NODE && node.tagName === 'DIALOG') {
          // Automatically click the "Cancel" button (No)
          const cancelButton = node.querySelector('#confirm-no');
          if (cancelButton) {
            delayClick(cancelButton);
          }
        }
      }
    }
  });

  const config = {
    childList: true, // Observe direct children of the document.body for changes
    subtree: true, // Observe all descendants of the document.body for changes
  };

  observer.observe(document.body, config);
}

snippet 2

the second snippet is used to render a pop-up confirm box

var userPreference;

if (confirm("Do you want to save changes?") == true) {
    userPreference = "Data saved successfully!";
} else {
    userPreference = "Save Cancelled!";
}

I ran the first snippet of code in Chrome’s console inspector and then the second one. The confirm box did pop up, but only in logging text. However, the first snippet didn’t let the confirm box stay for 2 seconds. How do I fix it?

Most efficient way to make an object of numbers (lengths) from an object of Sets in Javascript?

I have a function that aims to take an object of strings Sets, kinds of like this :

interface Input {
  userIds: Set<string>;
  companyIds: Set<string>;
  actionIds: Set<string>;
}

and return an object of numbers (the length of every Set), kinds of like this :

interface Output {
  users: number;
  companies: number;
  actions: number;
}

I’m looking for the most efficient way to do that. Keep in my mind that my real Input and Output have dozens of entries and each set might have thousands of entries each.

joi custom with jest throws Method must be a function

I have multiple schemas defined, one of them being

import Joi from 'joi';
import {dateTimeValidationHelper} from '../../services/validator.service';

export const DATE_TIME_SCHEME = Joi.string().custom(dateTimeValidationHelper);

the custom function looks like this

import coreJoi from 'joi';
import joiDate from '@joi/date';
const Joi = coreJoi.extend(joiDate) as typeof coreJoi;

export const dateTimeValidationHelper = (input: string, helper: coreJoi.CustomHelpers) => {
    const schema = Joi.date();
    const { error } = schema.validate(input);
    if (error) return helper.error(`${error}`);
    const inputDate = new Date(input);
    return `${inputDate.getFullYear()}-${padZero(inputDate.getMonth() + 1)}-${padZero(inputDate.getDate())} ${padZero(inputDate.getHours())}:${padZero(inputDate.getMinutes())}:${padZero(inputDate.getSeconds())}`;
}

function padZero(num: number): string {
    return num.toString().padStart(2, '0');
}

Everytime I run this with jest I get Method must be a function. The weird thing is, it worked a few months ago and I didn’t update jest or joi. I have other similar schemas and they all don’t work anymore. I already checked the official documentation but I can’t find the issue. Does anyone have similar problems and can help?

Import extensions of Array interface/prototype in nodejs

I have created a ts file array.extensions.d.ts for extending arrays in my node project.

export {};

declare global {
  interface Array<T> {
    remove(o: T): Array<T>;
    isEmpty: boolean;
    isNotEmpty: boolean;
    first: T;
    last: T;
  }
}

Object.defineProperty(Array.prototype, 'isEmpty', {
  configurable: true,
  get() {
    return this.length === 0;
  },
});

Object.defineProperty(Array.prototype, 'isNotEmpty', {
  configurable: true,
  get() {
    return this.length > 0;
  },
});

Object.defineProperty(Array.prototype, 'first', {
  configurable: true,
  get() {
    return this[0];
  },
});

Object.defineProperty(Array.prototype, 'last', {
  configurable: true,
  get() {
    return this[this.length - 1];
  },
});

Array.prototype.remove = function (o) {
  const i = this.indexOf(o);
  if (i > -1) {
    return this.splice(i, 1);
  }
  return [];
};

I also added “./src/shared/extensions” to the typeRoots property in my tsconfig.json file.

In VScode IntelliSense i see the new properties of the arrays and i can use them without any errors showing up.

But when running my code i get the error message
Property 'isEmpty' does not exist on type 'User[]'

I am not sure, if and where i need to import my extension file. In the IDE everything seems fine without any import at all.

So if someone could point me in the right direction, this would be awesome.

Thank you

How can I fix vue compiling error Unexpected token, expected “,” Vuejs with Babel and Webpack

Im currently working on a Vue.js project, and I’ve encountered an error during the build process that I’m unable to solve.

The error message is:

Unexpected token, expected "," (1:8)

and it occurs in 52 file, during the Webpack compilation.

This error suggests there’s a syntax issue, however, I’ve thoroughly checked the component and everything seems to be okay. The exact error message from the Babel-loader module.

Here’s the version of the packages I’m using:

├─┬ @aws-amplify/[email protected]
│ ├─┬ @vueuse/[email protected]
│ │ ├─┬ @vueuse/[email protected]
│ │ │ └── [email protected] deduped
│ │ ├─┬ [email protected]
│ │ │ └── [email protected] deduped
│ │ └─┬ [email protected]
│ │   └─┬ @vue/[email protected]
│ │     └── [email protected] deduped
│ └─┬ @xstate/[email protected]
│   └── [email protected] deduped
├─┬ @sentry/[email protected]
│ └── [email protected] deduped
├─┬ @vue/[email protected]
│ └─┬ @vue/[email protected]
│   ├─┬ @vue/[email protected]
│   │ └── [email protected] deduped
│   └── [email protected] deduped
├─┬ @vue/[email protected]
│ └── [email protected] deduped
├─┬ [email protected]
│ └── [email protected] deduped
├─┬ [email protected]
│ ├─┬ [email protected]
│ │ └── [email protected] deduped
│ └── [email protected] deduped
├─┬ [email protected]
│ └── [email protected] deduped
├─┬ [email protected]
│ ├─┬ [email protected]
│ │ └── [email protected] deduped
│ ├─┬ [email protected]
│ │ └── [email protected] deduped
│ ├─┬ [email protected]
│ │ └── [email protected] deduped
│ └── [email protected] deduped
├─┬ [email protected]
│ ├─┬ [email protected]
│ │ └── [email protected] deduped
│ └── [email protected] deduped
├── [email protected]
├─┬ [email protected]
│ └── [email protected] deduped
└─┬ [email protected]
  └── [email protected] deduped

[email protected] /Users/timefonds-nazlican/Desktop/Timefonds/hr-console
├─┬ @babel/[email protected]
│ ├─┬ @babel/[email protected]
│ │ └── @babel/[email protected] deduped
│ └─┬ @babel/[email protected]
│   └── @babel/[email protected] deduped
├─┬ @babel/[email protected]
│ └── @babel/[email protected] deduped
├─┬ @graphql-codegen/[email protected]
│ └─┬ @graphql-tools/[email protected]
│   └─┬ @graphql-tools/[email protected]
│     └─┬ @babel/[email protected]
│       └── @babel/[email protected] deduped
├─┬ @graphql-codegen/[email protected]
│ └─┬ @graphql-codegen/[email protected]
│   └─┬ @graphql-tools/[email protected]
│     └─┬ @ardatan/[email protected]
│       ├── @babel/[email protected] deduped
│       └─┬ [email protected]
│         ├── @babel/[email protected] deduped
│         ├─┬ @babel/[email protected]
│         │ └── @babel/[email protected] deduped
│         ├─┬ @babel/[email protected]
│         │ └── @babel/[email protected] deduped
│         ├─┬ @babel/[email protected]
│         │ └── @babel/[email protected] deduped
│         ├─┬ @babel/[email protected]
│         │ └── @babel/[email protected] deduped
│         └─┬ @babel/[email protected]
│           └── @babel/[email protected] deduped
├─┬ @vue/[email protected]
│ ├── @babel/[email protected] deduped
│ ├─┬ @vue/[email protected]
│ │ ├── @babel/[email protected] deduped
│ │ ├─┬ @babel/[email protected]
│ │ │ ├── @babel/[email protected] deduped
│ │ │ └─┬ @babel/[email protected]
│ │ │   └── @babel/[email protected] deduped
│ │ ├─┬ @babel/[email protected]
│ │ │ ├── @babel/[email protected] deduped
│ │ │ ├─┬ @babel/[email protected]
│ │ │ │ └── @babel/[email protected] deduped
│ │ │ └─┬ @babel/[email protected]
│ │ │   └── @babel/[email protected] deduped
│ │ ├─┬ @babel/[email protected]
│ │ │ └── @babel/[email protected] deduped
│ │ ├─┬ @babel/[email protected]
│ │ │ └── @babel/[email protected] deduped
│ │ ├─┬ @babel/[email protected]
│ │ │ ├── @babel/[email protected] deduped
│ │ │ ├─┬ [email protected]
│ │ │ │ ├── @babel/[email protected] deduped
│ │ │ │ └─┬ @babel/[email protected]
│ │ │ │   └── @babel/[email protected] deduped
│ │ │ ├─┬ [email protected]
│ │ │ │ └── @babel/[email protected] deduped
│ │ │ └─┬ [email protected]
│ │ │   └── @babel/[email protected] deduped
│ │ ├─┬ @babel/[email protected]
│ │ │ ├── @babel/[email protected] deduped
│ │ │ ├─┬ @babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@7.22.5
│ │ │ │ └── @babel/[email protected] deduped
│ │ │ ├─┬ @babel/[email protected]
│ │ │ │ └── @babel/[email protected] deduped
│ │ │ ├─┬ @babel/plugin-proposal-private-property-in-object@7.21.0-placeholder-for-preset-env.2
│ │ │ │ └── @babel/[email protected] deduped
│ │ │ ├─┬ @babel/[email protected]
│ │ │ │ └── @babel/[email protected] deduped
│ │ │ ├─┬ @babel/[email protected]
│ │ │ │ └── @babel/[email protected] deduped
│ │ │ ├─┬ @babel/[email protected]
│ │ │ │ └── @babel/[email protected] deduped
│ │ │ ├─┬ @babel/[email protected]
│ │ │ │ └── @babel/[email protected] deduped
│ │ │ ├─┬ @babel/[email protected]
│ │ │ │ └── @babel/[email protected] deduped
│ │ │ ├─┬ @babel/[email protected]
│ │ │ │ └── @babel/[email protected] deduped
│ │ │ ├─┬ @babel/[email protected]
│ │ │ │ └── @babel/[email protected] deduped
│ │ │ ├─┬ @babel/[email protected]
│ │ │ │ └── @babel/[email protected] deduped
│ │ │ ├─┬ @babel/[email protected]
│ │ │ │ └── @babel/[email protected] deduped
│ │ │ ├─┬ @babel/[email protected]
│ │ │ │ └── @babel/[email protected] deduped
│ │ │ ├─┬ @babel/[email protected]
│ │ │ │ └── @babel/[email protected] deduped
│ │ │ ├─┬ @babel/[email protected]
│ │ │ │ └── @babel/[email protected] deduped
│ │ │ ├─┬ @babel/[email protected]
│ │ │ │ └── @babel/[email protected] deduped
│ │ │ ├─┬ @babel/[email protected]
│ │ │ │ └── @babel/[email protected] deduped
│ │ │ ├─┬ @babel/[email protected]
│ │ │ │ └── @babel/[email protected] deduped
│ │ │ ├─┬ @babel/[email protected]
│ │ │ │ ├── @babel/[email protected] deduped
│ │ │ │ └─┬ @babel/[email protected]
│ │ │ │   └── @babel/[email protected] deduped
│ │ │ ├─┬ @babel/[email protected]
│ │ │ │ └── @babel/[email protected] deduped
│ │ │ ├─┬ @babel/[email protected]
│ │ │ │ ├── @babel/[email protected] deduped
│ │ │ │ └─┬ @babel/[email protected]
│ │ │ │   └── @babel/[email protected] deduped
│ │ │ ├─┬ @babel/[email protected]
│ │ │ │ └── @babel/[email protected] deduped
│ │ │ ├─┬ @babel/[email protected]
│ │ │ │ └── @babel/[email protected] deduped
│ │ │ ├─┬ @babel/[email protected]
│ │ │ │ └── @babel/[email protected] deduped
│ │ │ ├─┬ @babel/[email protected]
│ │ │ │ └── @babel/[email protected] deduped
│ │ │ ├─┬ @babel/[email protected]
│ │ │ │ └── @babel/[email protected] deduped
│ │ │ ├─┬ @babel/[email protected]
│ │ │ │ └── @babel/[email protected] deduped
│ │ │ ├─┬ @babel/[email protected]
│ │ │ │ └── @babel/[email protected] deduped
│ │ │ ├─┬ @babel/[email protected]
│ │ │ │ └── @babel/[email protected] deduped
│ │ │ ├─┬ @babel/[email protected]
│ │ │ │ └── @babel/[email protected] deduped
│ │ │ ├─┬ @babel/[email protected]
│ │ │ │ └── @babel/[email protected] deduped
│ │ │ ├─┬ @babel/[email protected]
│ │ │ │ └── @babel/[email protected] deduped
│ │ │ ├─┬ @babel/[email protected]
│ │ │ │ └── @babel/[email protected] deduped
│ │ │ ├─┬ @babel/[email protected]
│ │ │ │ └── @babel/[email protected] deduped
│ │ │ ├─┬ @babel/[email protected]
│ │ │ │ └── @babel/[email protected] deduped
│ │ │ ├─┬ @babel/[email protected]
│ │ │ │ └── @babel/[email protected] deduped
│ │ │ ├─┬ @babel/[email protected]
│ │ │ │ └── @babel/[email protected] deduped
│ │ │ ├─┬ @babel/[email protected]
│ │ │ │ └── @babel/[email protected] deduped
│ │ │ ├─┬ @babel/[email protected]
│ │ │ │ └── @babel/[email protected] deduped
│ │ │ ├─┬ @babel/[email protected]
│ │ │ │ └── @babel/[email protected] deduped
│ │ │ ├─┬ @babel/[email protected]
│ │ │ │ └── @babel/[email protected] deduped
│ │ │ ├─┬ @babel/[email protected]
│ │ │ │ └── @babel/[email protected] deduped
│ │ │ ├─┬ @babel/[email protected]
│ │ │ │ └── @babel/[email protected] deduped
│ │ │ ├─┬ @babel/[email protected]
│ │ │ │ └── @babel/[email protected] deduped
│ │ │ ├─┬ @babel/[email protected]
│ │ │ │ └── @babel/[email protected] deduped
│ │ │ ├─┬ @babel/[email protected]
│ │ │ │ └── @babel/[email protected] deduped
│ │ │ ├─┬ @babel/[email protected]
│ │ │ │ └── @babel/[email protected] deduped
│ │ │ ├─┬ @babel/[email protected]
│ │ │ │ └── @babel/[email protected] deduped
│ │ │ ├─┬ @babel/[email protected]
│ │ │ │ └── @babel/[email protected] deduped
│ │ │ ├─┬ @babel/[email protected]
│ │ │ │ └── @babel/[email protected] deduped
│ │ │ ├─┬ @babel/[email protected]
│ │ │ │ └── @babel/[email protected] deduped
│ │ │ ├─┬ @babel/[email protected]
│ │ │ │ └── @babel/[email protected] deduped
│ │ │ ├─┬ @babel/[email protected]
│ │ │ │ └── @babel/[email protected] deduped
│ │ │ ├─┬ @babel/[email protected]
│ │ │ │ └── @babel/[email protected] deduped
│ │ │ ├─┬ @babel/[email protected]
│ │ │ │ └── @babel/[email protected] deduped
│ │ │ ├─┬ @babel/[email protected]
│ │ │ │ └── @babel/[email protected] deduped
│ │ │ ├─┬ @babel/[email protected]
│ │ │ │ └── @babel/[email protected] deduped
│ │ │ ├─┬ @babel/[email protected]
│ │ │ │ └── @babel/[email protected] deduped
│ │ │ ├─┬ @babel/[email protected]
│ │ │ │ └── @babel/[email protected] deduped
│ │ │ ├─┬ @babel/[email protected]
│ │ │ │ └── @babel/[email protected] deduped
│ │ │ ├─┬ @babel/[email protected]
│ │ │ │ └── @babel/[email protected] deduped
│ │ │ ├─┬ @babel/[email protected]
│ │ │ │ └── @babel/[email protected] deduped
│ │ │ ├─┬ @babel/[email protected]
│ │ │ │ └── @babel/[email protected] deduped
│ │ │ ├─┬ @babel/[email protected]
│ │ │ │ └── @babel/[email protected] deduped
│ │ │ ├─┬ @babel/[email protected]
│ │ │ │ └── @babel/[email protected] deduped
│ │ │ ├─┬ @babel/[email protected]
│ │ │ │ └── @babel/[email protected] deduped
│ │ │ ├─┬ @babel/[email protected]
│ │ │ │ └── @babel/[email protected] deduped
│ │ │ └─┬ @babel/[email protected]
│ │ │   ├── @babel/[email protected] deduped
│ │ │   └─┬ @babel/[email protected]
│ │ │     └── @babel/[email protected] deduped
│ │ ├─┬ @vue/[email protected]
│ │ │ └── @babel/[email protected] deduped
│ │ └─┬ @vue/[email protected]
│ │   ├── @babel/[email protected] deduped
│ │   ├─┬ @vue/[email protected]
│ │   │ └── @babel/[email protected] deduped
│ │   ├─┬ @vue/[email protected]
│ │   │ └── @babel/[email protected] deduped
│ │   ├─┬ @vue/[email protected]
│ │   │ └── @babel/[email protected] deduped
│ │   ├─┬ @vue/[email protected]
│ │   │ └── @babel/[email protected] deduped
│ │   ├─┬ @vue/[email protected]
│ │   │ └── @babel/[email protected] deduped
│ │   ├─┬ @vue/[email protected]
│ │   │ └── @babel/[email protected] deduped
│ │   └─┬ @vue/[email protected]
│ │     └── @babel/[email protected] deduped
│ └─┬ [email protected]
│   └── @babel/[email protected] deduped
├─┬ @vue/[email protected]
│ └── @babel/[email protected] deduped
└─┬ [email protected]
  └─┬ @aws-amplify/[email protected]
    └─┬ @aws-sdk/[email protected]
      └─┬ @aws-sdk/[email protected]
        └─┬ [email protected]
          └─┬ [email protected]
            ├─┬ @react-native-community/[email protected]
            │ └─┬ @react-native-community/[email protected]
            │   ├─┬ [email protected]
            │   │ ├── @babel/[email protected] deduped
            │   │ └─┬ [email protected]
            │   │   ├── @babel/[email protected] deduped
            │   │   ├─┬ @babel/[email protected]
            │   │   │ └── @babel/[email protected] deduped
            │   │   ├─┬ @babel/[email protected]
            │   │   │ └── @babel/[email protected] deduped
            │   │   ├─┬ @babel/[email protected]
            │   │   │ └── @babel/[email protected] deduped
            │   │   ├─┬ @babel/[email protected]
            │   │   │ └── @babel/[email protected] deduped
            │   │   ├─┬ @babel/[email protected]
            │   │   │ └── @babel/[email protected] deduped
            │   │   ├─┬ @babel/[email protected]
            │   │   │ └── @babel/[email protected] deduped
            │   │   └─┬ @babel/[email protected]
            │   │     └── @babel/[email protected] deduped
            │   └─┬ [email protected]
            │     ├── @babel/[email protected] deduped
            │     ├─┬ [email protected]
            │     │ └── @babel/[email protected] deduped
            │     ├─┬ [email protected]
            │     │ └── @babel/[email protected] deduped
            │     └─┬ [email protected]
            │       └── @babel/[email protected] deduped
            └─┬ @react-native/[email protected]
              └─┬ [email protected]
                ├── @babel/[email protected] deduped
                ├─┬ @babel/[email protected]
                │ └── @babel/[email protected] deduped
                ├─┬ @babel/[email protected]
                │ └── @babel/[email protected] deduped
                ├─┬ @babel/[email protected]
                │ └── @babel/[email protected] deduped
                ├─┬ @babel/[email protected]
                │ ├── @babel/[email protected] deduped
                │ └─┬ @babel/[email protected]
                │   ├── @babel/[email protected] deduped
                │   └─┬ @babel/[email protected]
                │     └── @babel/[email protected] deduped
                ├─┬ @babel/[email protected]
                │ └── @babel/[email protected] deduped
                └─┬ [email protected]
                  └── @babel/[email protected] deduped

[email protected] 
├─┬ @vue/[email protected]
│ ├─┬ [email protected]
│ │ └── [email protected] deduped
│ ├─┬ [email protected]
│ │ └── [email protected] deduped
│ └── [email protected] deduped
├─┬ @vue/[email protected]
│ ├─┬ [email protected]
│ │ └── [email protected] deduped
│ └── [email protected] deduped
├─┬ @vue/[email protected]
│ ├─┬ [email protected]
│ │ └── [email protected] deduped
│ ├─┬ [email protected]
│ │ └── [email protected] deduped
│ └── [email protected] deduped
├─┬ @vue/[email protected]
│ ├─┬ @soda/[email protected]
│ │ └── [email protected] deduped
│ ├─┬ @vue/vue-loader-v15@npm:[email protected]
│ │ └── [email protected] deduped
│ ├─┬ [email protected]
│ │ └── [email protected] deduped
│ ├─┬ [email protected]
│ │ └── [email protected] deduped
│ ├─┬ [email protected]
│ │ └── [email protected] deduped
│ ├─┬ [email protected]
│ │ └── [email protected] deduped
│ ├─┬ [email protected]
│ │ └── [email protected] deduped
│ ├─┬ [email protected]
│ │ └── [email protected] deduped
│ ├─┬ [email protected]
│ │ └── [email protected] deduped
│ ├─┬ [email protected]
│ │ └── [email protected] deduped
│ ├─┬ [email protected]
│ │ └── [email protected] deduped
│ ├─┬ [email protected]
│ │ ├─┬ [email protected]
│ │ │ └── [email protected] deduped
│ │ └── [email protected] deduped
│ └── [email protected] deduped
├─┬ [email protected]
│ └── [email protected] deduped
├─┬ [email protected]
│ ├─┬ [email protected]
│ │ └── [email protected] deduped
│ └── [email protected] deduped
├─┬ [email protected]
│ ├─┬ [email protected]
│ │ └── [email protected] deduped
│ └── [email protected] deduped
└── [email protected]

[email protected] 
└── [email protected]

If anyone could help me understand why this error is occurring and how to fix it, I would greatly appreciate it. Let me know if you need more information.

How to use Cloudinary backend SDK on the frontend?

We’re implementing an upload of large files to Cloudinary. To avoid routing the data through our backend I’d like to upload directly to Cloudinary using unsigned upload[1] in the browser.

Since I need to support files larger than 100 MB I also need to use the chunked method for larger files.

The frontend is a React app. I went through all the Cloudinary frontend SDKs but I can’t find exactly what I need.

  • The “upload widget” doesn’t fit in our design.
  • We don’t use JQuery so we can’t (and don’t want to) use the Jquery Cloudinary plugin.

We just want to call the APIs directly hence we’d like to use Backend Node SDK and its upload_stream and upload_large_stream methods which do the heavy lifting of chunking the file. Unfortunately, this SDK relies on Node APIs and can’t be used in browsers.

What else are our options here?


[1] or possibly fetching the request signature from a specially prepared backend endpoint.

how to create access provider function in react js?

i am trying to build form using JSON. I am using below library to generate form.

https://www.react-hook-form.com/

issue .: I am trying to access hook function on Parent component . But I am not able to access. Any suggestion how to access hooks methods on Parent component . shall I create a new Provider or contest and Wrap that Provider Frombuilder component . Shall it works ?

here is my code
https://codesandbox.io/s/react-hook-form-v7-form-context-forked-hlq9hm?file=/src/index.js

function App() {
  // const methods = useForm();

  const onChange = () => {
    console.log("000000");
    //methods.setValue("firstName", "asdasd");
  };

  // const { registerState, handleSubmit } = methods;

  const onSubmit = (data) => {
    console.log(data);
  };
  return (
    <FormBuilder
      jsonSchema={json}
      defaultValue={defaultValue}
      onSubmitHandler={onSubmit}
      functionHandler={{
        onChange: onChange
      }}
    />
  );
}

I want to access setValue , getValue function on App component . is it possible ?

can I create one more provider or any ref ?

need to get hook function linke setValue, getValue.

I am trying like this . when I am changing select box option . On change handler below function called.

 const onChange = () => {
    console.log("000000");
    //methods.setValue("firstName", "asdasd");
  };

No such customer: ‘cus_OIR5UsvZncTECx’; a similar object exists in test mode, but a live mode key was used to make this request.”

I’m using stripe with the firebase extension and have recently swtiched from test mode to live mode on Stripe. I’ve recreated the products and modified the webhook and API keys on on my firebase extension. However, when I try to create a checkout session, the session returns this error:

No such customer: ‘cus_OIR5UsvZncTECx. A similar object exists in test mode, but a live mode key was used to make this request.

const checkoutSessionRef = doc(sessionRef, checkoutSessionId);
  onSnapshot(checkoutSessionRef, async (snap) => {
    console.log(snap.data())
    const { sessionId } = snap.data();
    console.log(snap.data().sessionId)
    console.log(sessionId)
    if (snap.exists()) {
      const stripe = await getStripe();
      stripe.redirectToCheckout( {sessionId});
    }
  });

My data that I was testing out stripe payments on was the same as my live data, so I know that there is some issue with a customer duplicate. However, I’m wondering if there’s a way around this where I can automatically switch my customer data and live data.