Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

279
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!