{"record":{"id":"885c5f04af043c13","repo":"naptha/tesseract.js","slug":"load-is-depreciated-and-should-be-removed-from-c","errorCode":null,"errorMessage":"`load` is depreciated and should be removed from code (workers now come pre-loaded)","messagePattern":"`load` is depreciated and should be removed from code \\(workers now come pre-loaded\\)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"info","filePath":"src/createWorker.js","lineNumber":67,"sourceCode":"  workerCounter += 1;\n\n  const startJob = ({ id: jobId, action, payload }) => (\n    new Promise((resolve, reject) => {\n      log(`[${id}]: Start ${jobId}, action=${action}`);\n      // Using both `action` and `jobId` in case user provides non-unique `jobId`.\n      const promiseId = `${action}-${jobId}`;\n      promises[promiseId] = { resolve, reject };\n      send(worker, {\n        workerId: id,\n        jobId,\n        action,\n        payload,\n      });\n    })\n  );\n\n  const load = () => (\n    console.warn('`load` is depreciated and should be removed from code (workers now come pre-loaded)')\n  );\n\n  const loadInternal = (jobId) => (\n    startJob(createJob({\n      id: jobId, action: 'load', payload: { options: { lstmOnly: lstmOnlyCore, corePath: options.corePath, logging: options.logging } },\n    }))\n  );\n\n  const writeText = (path, text, jobId) => (\n    startJob(createJob({\n      id: jobId,\n      action: 'FS',\n      payload: { method: 'writeFile', args: [path, text] },\n    }))\n  );\n\n  const readText = (path, jobId) => (\n    startJob(createJob({","sourceCodeStart":49,"sourceCodeEnd":85,"githubUrl":"https://github.com/naptha/tesseract.js/blob/a1ca80d9e31c34512d0ded75ff8821ddcf3f2f91/src/createWorker.js#L49-L85","documentation":"worker.load() previously triggered loading of the WASM core and language data. In current versions, createWorker auto-runs loadInternal() (src/createWorker.js:239) during construction, so workers arrive ready. The load() method is retained only for backward compatibility and now just emits console.warn with no functional effect.","triggerScenarios":"Calling await worker.load() in user code. The call resolves instantly after printing the warning and changes nothing.","commonSituations":"Copy-pasting examples from Tesseract.js v2 tutorials or older docs; migrating from an earlier API where load() was required; IDE autocomplete suggesting load().","solutions":["Delete the worker.load() call — the worker is ready as soon as createWorker(...) resolves.","If keeping it temporarily to avoid breaking flows, note it is a no-op and schedule removal.","Update documentation/examples in your codebase to the v4/v5 pattern."],"exampleFix":"// before\nconst worker = await createWorker('eng');\nawait worker.load(); // deprecated, prints warning\nawait worker.recognize(img);\n\n// after\nconst worker = await createWorker('eng');\nawait worker.recognize(img);","handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":["Search your codebase for '.load()' on worker instances and remove every call.","When migrating from older Tesseract.js, treat createWorker resolving as the new readiness signal.","Pin to current major-version docs so examples do not include the deprecated call."],"tags":["deprecation","api-migration","load"],"backgroundTag":null,"analyzedSha":"a1ca80d9e31c34512d0ded75ff8821ddcf3f2f91","analyzedAt":"2026-08-13T04:28:13.744Z","schemaVersion":2},"datasetVersion":"2026-08-13T09:17:06.757Z"}