PicoCreator / smol-dev-js

Smol personal AI, for smol incremental tasks in a JS project
MIT License
325 stars 53 forks source link

Running into ENOENT error #2

Closed szymonhernik closed 1 year ago

szymonhernik commented 1 year ago

This is the error I'm running into each time after I give the plan a go.

✔ [you]: Proceed with the plan? … yes
🐣 [ai]: Working on the plan ...
🐣 [ai]: Studying 0 dependencies (in parallel)
🐣 [ai]: Performing any required modules install / file moves / deletion
Confirm the excution of 'npm install next react react-dom remark remark-html'
? [you]: Install listed dependencies? › (Y/n)🐣 [ai]: Studying 0 dependencies (awaiting in parallel)
🐣 [ai]: Preparing summaries for smol-er sub-operations ...
🐣 [ai]: (async) Updating src file - src/pages/_app.js
🐣 [ai]: (async) Updating src file - src/components
🐣 [ai]: (async) Updating src file - src/lib
🐣 [ai]: (async) Updating src file - src/posts
🐣 [ai]: (async) Updating src file - src/posts/sample-post.md
🐣 [ai]: (async) Updating src file - package.json
Error: ENOENT: no such file or directory, open '/Users/username/smoll-dev-js-project-1/src/components'

Nothing is rendered into the folder prior to this error. I have no src folder.

Thanks for any help

PicoCreator commented 1 year ago

Did you configure src folder to be "src" during setup? I believe I will need to add a mkdir step to ensure such folders are setup as part of config step (which causes this error)

szymonhernik commented 1 year ago

Hey :) Thank you for your quick reply! This didn't solve the error...

If I set "src_dir": "src" to config file I get the similar error but with another directory Error: ENOENT: no such file or directory, open '/Users/username/smoll-dev-js-project-1/src/lib/posts.ts'. I tried also creating src directory in the project folder manually but nothing is being written there.

PicoCreator commented 1 year ago

My bad, found the issue - I didn't add the code to create the required subfolders prior to creating the file - fixed and push in 1.2.15

PicoCreator commented 1 year ago

https://github.com/PicoCreator/smol-dev-js/commit/b8d5a1c861edce20693365d00afc7d06fa4a1846

szymonhernik commented 1 year ago

It solved the problem. Thanks a lot for looking into this. Just started testing the small-dev-js!

There was one more error I run into: ReferenceError: child_process is not defined at getOperationFileMapFromPlan (/usr/local/lib/node_modules/smol-dev-js/src/ai/seq/applyOperationFileMapFromPlan.js:70:3) , which i managed to solve by adding const child_process = require('child_process'); at the top of the file that threw the error.