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

403
Views
ClientError: no se puede analizar el valor de "$tweetId=undefined". Por favor cita valores de cadena

Estoy usando la cordura, también si necesita más información se la proporcionaré lo antes posible. Cuando voy a http://localhost:3000/api/getComments me escribe ese error:

ClientError: no se puede analizar el valor de "$tweetId=undefined". Por favor cita valores de cadena.

buscarComentarios.ts

 import { Comment } from "../typings" export const fetchComments = async (tweetId: string) => { const res = await fetch(`/api/getComments?tweetId=${tweetId}`) const comments: Comment[] = await res.json() return comments }

obtenerComentarios.ts

 import type { NextApiRequest, NextApiResponse } from "next"; import { groq } from "next-sanity"; import { sanityClient } from "../../sanitytwitter/sanity"; import { Comment } from "../../typings"; const commentQuery = groq` *[_type == "comment" && references(*[_type == 'tweet' && _id == $tweetId]._id )] { _id, ... } | order(_createdAt desc) ` type Data = Comment[] export default async function handler( req: NextApiRequest, res: NextApiResponse<Data> ) { const { tweetId } = req.query; const comments: Comment[] = await sanityClient.fetch(commentQuery, { tweetId, }) res.status(200).json(comments) }
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!