context-labs / autodoc

Experimental toolkit for auto-generating codebase documentation using LLMs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Failed to get Summary, Headers is not defined

Bewinxed opened this issue · comments

Just ran this on a directory with the .gitignore folders excluded:

I get this on each file traversed:

ReferenceError: Headers is not defined
    at createRequest (file:///home/bewinxed/.nvm/versions/node/v16.19.1/lib/node_modules/@context-labs/autodoc/node_modules/langchain/dist/util/axios-fetch-adapter.js:234:21)
    at fetchAdapter (file:///home/bewinxed/.nvm/versions/node/v16.19.1/lib/node_modules/@context-labs/autodoc/node_modules/langchain/dist/util/axios-fetch-adapter.js:164:21)
    at dispatchRequest (/home/bewinxed/.nvm/versions/node/v16.19.1/lib/node_modules/@context-labs/autodoc/node_modules/axios/lib/core/dispatchRequest.js:58:10)
    at Axios.request (/home/bewinxed/.nvm/versions/node/v16.19.1/lib/node_modules/@context-labs/autodoc/node_modules/axios/lib/core/Axios.js:108:15)
    at Function.wrap [as request] (/home/bewinxed/.nvm/versions/node/v16.19.1/lib/node_modules/@context-labs/autodoc/node_modules/axios/lib/helpers/bind.js:9:15)
    at /home/bewinxed/.nvm/versions/node/v16.19.1/lib/node_modules/@context-labs/autodoc/node_modules/openai/dist/common.js:149:22
    at /home/bewinxed/.nvm/versions/node/v16.19.1/lib/node_modules/@context-labs/autodoc/node_modules/openai/dist/api.js:1738:133

at the end of it all:

Failed to get summary for file whitelists.py
✔ Processing 724 files...
⠋ Processing 168 folders... The provided folder path does not exist.
✔ Processing 168 folders... 
✔ Processing repository...
⠋ Creating markdown files...The provided folder path does not exist.
The provided folder path does not exist.
✔ Created 0 mardown files...
⠋ Create vector files...Error: ENOENT: no such file or directory, scandir '.autodoc/docs/markdown/'
    at Module.readdirSync (node:fs:1438:3)
    at processDirectory (file:///home/bewinxed/.nvm/versions/node/v16.19.1/lib/node_modules/@context-labs/autodoc/dist/cli/commands/index/createVectorStore.js:29:20)
    at RepoLoader.load (file:///home/bewinxed/.nvm/versions/node/v16.19.1/lib/node_modules/@context-labs/autodoc/dist/cli/commands/index/createVectorStore.js:57:22)
    at createVectorStore (file:///home/bewinxed/.nvm/versions/node/v16.19.1/lib/node_modules/@context-labs/autodoc/dist/cli/commands/index/createVectorStore.js:62:34)
    at index (file:///home/bewinxed/.nvm/versions/node/v16.19.1/lib/node_modules/@context-labs/autodoc/dist/cli/commands/index/index.js:39:11) {
  errno: -2,
  syscall: 'scandir',
  code: 'ENOENT',
  path: '.autodoc/docs/markdown/'
}
Error: Could not read directory: .autodoc/docs/markdown/. Did you run `sh download.sh`?
    at processDirectory (file:///home/bewinxed/.nvm/versions/node/v16.19.1/lib/node_modules/@context-labs/autodoc/dist/cli/commands/index/createVectorStore.js:33:15)
    at RepoLoader.load (file:///home/bewinxed/.nvm/versions/node/v16.19.1/lib/node_modules/@context-labs/autodoc/dist/cli/commands/index/createVectorStore.js:57:22)
    at createVectorStore (file:///home/bewinxed/.nvm/versions/node/v16.19.1/lib/node_modules/@context-labs/autodoc/dist/cli/commands/index/createVectorStore.js:62:34)
    at index (file:///home/bewinxed/.nvm/versions/node/v16.19.1/lib/node_modules/@context-labs/autodoc/dist/cli/commands/index/index.js:39:11)
✖ Create vector files...

You're probably using a version of node that is < v18. This error is because the fetch-polyfill from older versions doesn't work properly.

Upgrading to node 18 or 19 should solve this issue.

You're probably using a version of node that is < v18. This error is because the fetch-polyfill from older versions doesn't work properly.

Upgrading to node 18 or 19 should solve this issue.

That solved it