sourcebot-dev / sourcebot

Blazingly fast code search 🏎️ Deployed as a single Docker image 📦 Search million+ lines of code in your GitHub, GitLab, and Gitea repositories 🪄 MIT licensed ✅
https://sourcebot.dev
MIT License
1.16k stars 37 forks source link

TypeError: a.toSorted is not a function #77

Closed er0k closed 1 week ago

er0k commented 1 week ago

I am getting this error trying out the new v2.4.2 container:

2024-11-18T17:10:43.761Z info: [main] Discovered 637 unique repositories from config.
2024-11-18T17:10:43.761Z error: [main] Failed to sync configuration file /data/conifg.json with error:
TypeError: a.toSorted is not a function
    at arraysEqualShallow (file:///app/packages/backend/dist/utils.js:72:23)
    at isRevisionsChanged (file:///app/packages/backend/dist/main.js:64:18)
    at isRepoReindxingRequired (file:///app/packages/backend/dist/main.js:76:13)
    at syncConfig (file:///app/packages/backend/dist/main.js:143:42)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async measure (file:///app/packages/backend/dist/utils.js:5:18)
    at async _syncConfig (file:///app/packages/backend/dist/main.js:191:36)
    at async main (file:///app/packages/backend/dist/main.js:226:5)

This doesn't occur in the v2.4.1 container.

brendan-kellam commented 1 week ago

Will take a look, thanks for the report

brendan-kellam commented 1 week ago

Ah yep this is my bad - I introduced a Array.prototype.toSorted call here, but it's only supported in NodeJs versions 20+ (the docker container is on 18).

I will update the node version of the container to 20

brendan-kellam commented 1 week ago

Kk was able to repro - bumping the version does resolve the issue. Just released v2.4.3. Just waiting on this GitHub action to be done

er0k commented 1 week ago

Just confirmed the error is gone in the v2.4.3 container. Thanks for the quick fix! 🚀

brendan-kellam commented 1 week ago

Great!