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

353
Views
Error de tiempo de ejecución no controlado: no se pudo cargar el script: /_next/static/chunks/pages/api/twitter/generate-auth-link.js

Tengo una etiqueta de Link que se parece a <Link href='/api/twitter/generate-auth-link'>Login with Twitter</Link> .

Ya creé pages/api/twitter/generate-auth-link.ts que se ve así:

 import { NextApiResponse } from 'next' import TwitterApi from 'twitter-api-v2' import { TWITTER_CONFIG } from '../../../lib/config' import { SERVER_URL } from '../../../utils/index' import { NextIronRequest } from '../../../types/index' import handler from '../../../server/api-route' const generateAuthLink = async ( req: NextIronRequest, res: NextApiResponse ) => { // Generate an authentication URL const { url, oauth_token, oauth_token_secret } = await new TwitterApi({ appKey: TWITTER_CONFIG.consumerKey, appSecret: TWITTER_CONFIG.consumerSecret, }).generateAuthLink(`${SERVER_URL}api/twitter/get-verifier-token`, {linkMode:'authorize'}) req.session.set(oauth_token, oauth_token_secret) await req.session.save() // redirect to the authentication URL res.redirect(url) } export default handler().get(generateAuthLink)

Cuando hago clic en él, arroja el siguiente error:

 1 of 1 unhandled error Unhandled Runtime Error Error: Failed to load script: /_next/static/chunks/pages/api/twitter/generate-auth-link.js Call Stack HTMLScriptElement.script.onerror node_modules/next/dist/client/route-loader.js (83:51)

¿Cómo lo soluciono?

Reproducción → https://github.com/deadcoder0904/twitter-api-v2-3-legged-login-using-next-connect

about 4 years ago · Juan Pablo Isaza
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!