Next.js Tesseract工人。负载挂在Vercel上

Next.js Tesseract工人。负载挂在Vercel上,next.js,tesseract,vercel,Next.js,Tesseract,Vercel,不确定是否有人可以帮忙,但我在本地网站上有一个OCR阅读器,在我的下一个js应用程序中使用Tesseract.js。 它在本地和读smy映像时工作良好,但当我部署到Vercel时,它挂在这条线上 等待worker.load() 事情是这样的 const worker = createWorker() console.log('createWorker') //attempt ocr on processed image await worker.load() console

不确定是否有人可以帮忙,但我在本地网站上有一个OCR阅读器,在我的下一个js应用程序中使用Tesseract.js。 它在本地和读smy映像时工作良好,但当我部署到Vercel时,它挂在这条线上

等待worker.load()

事情是这样的

  const worker = createWorker()
  console.log('createWorker')

  //attempt ocr on processed image
  await worker.load()
  console.log('worker.load')

  //set language to plain english
  await worker.loadLanguage('eng')
  await worker.initialize('eng')

  //set character whitelist and disable dictionary functions that won't help us here
  await worker.setParameters({
    tessedit_char_whitelist:
      '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-/$.@| ',
    load_system_dawg: 0,
    load_freq_dawg: 0,
  })
  console.log('setParameters')

  //process editted image
  const OcrResult = await worker.recognize(imageb64)
  if (process.env.DEBUG >= 1) {
    console.log('[DEBUG] OCR: Process complete, results: ', OcrResult.data.text)
  }
关于Vercel有什么怪癖会使它无法在测试站点上运行吗


谢谢

您可以尝试改用类似的东西,用于lambda函数