Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

227
Visualizações
Property 'customerID' does not exist on type 'Window & typeof globalThis'

I'm new to programming, building a widget. Inside the for loop here, I have access to the clientID. I want to use this Client ID in other modules. How to make it Globally available.


for (let i = 0; i < loaderObject.q.length; i++) {
        const item = loaderObject.q[i];
        const methodName = item[0];
        console.log(methodName);
        if (i === 0 && methodName !== 'init') {
            throw new Error(
                `Failed to start Widget [${instanceName}]. 'init' must be called before other methods.`
            );
        } else if (i !== 0 && methodName === 'init') {
            continue;
        }



      
const loaderObject  = Object.assign(defaultConfig, item[1]);
       const clientID = loaderObject.clientID
       window.customerID = clientID ; // Is this right approach? 



        switch (methodName) {
            case 'init':

                const loadedObject = Object.assign(defaultConfig, item[1]);
                if (loadedObject.debug) {
                    console.log(
                        `Starting widget [${instanceName}]`,
                        loadedObject
                    );
                    console.log( "clientID", loadedObject.clientID)
                }

i'm getting this error

Property 'customerID' does not exist on type 'Window & typeof globalThis'.

I want to use this CustomerID in another module main.js. How to do this?

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda