bdcorps/langchain-pdf-qa

Headers is not defined error ?

Opened this issue · 2 comments

Screenshot 2023-04-10 at 11 38 43 AM

Please guide how to use it ? I am unable to make it work. I have created .env file and added my api key but getting this error

@tariq235 I ran into the same issue on node 16, once I switched to node 18.15.0 and did a fresh install, everything worked.

I've tried everything and still receive header errors. I'm now on node 19.0

langchain-basic@1.0.0 dev
> ts-node-dev --respawn --transpile-only src/ask-pdf.ts

[INFO] 13:57:47 ts-node-dev ver. 2.0.0 (using ts-node ver. 10.9.1, typescript ver. 5.0.4)
Compilation error in ***/pyquant/langchain-pdf-qa/src/ask-pdf.ts
Error: Must use import to load ES Module: ***pyquant/langchain-pdf-qa/src/ask-pdf.ts
    at Object.<anonymous> (***/pyquant/langchain-pdf-qa/src/ask-pdf.ts:1:7)
    at Module._compile (node:internal/modules/cjs/loader:1101:14)
    at Module._compile (***/pyquant/langchain-pdf-qa/node_modules/source-map-support/source-map-support.js:568:25)
    at Module.m._compile (/private/var/folders/dl/03m_wx_93zd2131tvkjm6mj40000gp/T/ts-node-dev-hook-38767195522161235.js:69:33)
    at Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
    at require.extensions..jsx.require.extensions..js (/private/var/folders/dl/03m_wx_93zd2131tvkjm6mj40000gp/T/ts-node-dev-hook-38767195522161235.js:114:20)
    at require.extensions.<computed> (/private/var/folders/dl/03m_wx_93zd2131tvkjm6mj40000gp/T/ts-node-dev-hook-38767195522161235.js:71:20)
    at Object.nodeDevHook [as .ts] (***pyquant/langchain-pdf-qa/node_modules/ts-node-dev/lib/hook.js:63:13)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
[ERROR] 13:57:47 Error: Must use import to load ES Module: /***/pyquant/langchain-pdf-qa/src/ask-pdf.ts