Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

281
Vistas
500 process is not defined ReferenceError: process is not defined

I am getting this problem every time I import a lib or when I use puppeteer and I don't know how to fix it. I am trying to get some data from LinkedIn using https://www.npmjs.com/package/linkedin-client the code is easy:

import LinkedinClient from 'linkedin-client';
    async function getIt() {
        const session = supabase.auth.session();

        const tok = session?.provider_token;
        const token = JSON.stringify(tok);
        console.log(token);
        
        const client = new LinkedinClient(token);
        const data = await client.fetch('https://www.linkedin.com/in/some-profile/');
        console.log(data);
    }

at first it gives me this error:Module "util" has been externalized for browser compatibility. Cannot access "util.promisify" in client code

after I install npm i util then it displays the following error:

500 process is not defined ReferenceError: process is not defined

Can you please let me know how to fix it?(I'm using sveltekit)

about 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

The library requires to be run on the server. It has be in a server endpoint, it cannot be in a component or a load function.

If this is already the case, this might be an issue with Vite trying to remove server dependencies. There is e.g. a plugin @esbuild-plugins/node-globals-polyfill which polyfills the process variable. It may also be necessary to list packages in resolve.alias in the Vite config, to point to the Node modules.

about 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda