microsoft / genaiscript

Automatable GenAI Scripting
https://microsoft.github.io/genaiscript/
MIT License
2k stars 113 forks source link

[ERROR] Could not resolve "./default_prompts" #878

Closed sahuguet closed 4 days ago

sahuguet commented 5 days ago

When running yarn --cwd packages/cli run compile from CodeSpace.

$ yarn --cwd packages/cli run compile
yarn run v1.22.22
$ esbuild src/main.ts --metafile=./esbuild.meta.json --bundle --platform=node --target=node20 --outfile=built/genaiscript.cjs --external:tsx --external:esbuild --external:get-tsconfig --external:resolve-pkg-maps --external:dockerode --external:pdfjs-dist --external:web-tree-sitter --external:tree-sitter-wasms --external:promptfoo --external:typescript --external:@lvce-editor/ripgrep --external:gpt-3-encoder --external:mammoth --external:xlsx --external:mathjs --external:@azure/identity --external:gpt-tokenizer --external:playwright --external:@inquirer/prompts --external:jimp --external:turndown --external:vectra --external:tabletojson --external:html-to-text --external:@octokit/rest --external:@octokit/plugin-throttling --external:@octokit/plugin-retry --external:@octokit/plugin-paginate-rest --external:skia-canvas && node ../../scripts/patch-cli.mjs
✘ [ERROR] Could not resolve "../../core/src/default_prompts"

    src/test.ts:20:32:
      20 │ import { promptFooDriver } from "../../core/src/default_prompts"
         ╵                                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

✘ [ERROR] Could not resolve "./default_prompts"

    ../core/src/treesitter.ts:3:32:
      3 │ import { treeSitterWasms } from "./default_prompts"
        ╵                                 ~~~~~~~~~~~~~~~~~~~

✘ [ERROR] Could not resolve "./default_prompts"

    ../core/src/scripts.ts:3:34:
      3 │ import { promptDefinitions } from "./default_prompts"
        ╵                                   ~~~~~~~~~~~~~~~~~~~

✘ [ERROR] Could not resolve "./default_prompts"

    ../core/src/parser.ts:4:31:
      4 │ import { defaultPrompts } from "./default_prompts" // Default prompt data
        ╵                                ~~~~~~~~~~~~~~~~~~~

4 errors
node:child_process:930
    throw err;
    ^

Error: Command failed: /workspaces/genaiscript/node_modules/@esbuild/linux-x64/bin/esbuild src/main.ts --metafile=./esbuild.meta.json --bundle --platform=node --target=node20 --outfile=built/genaiscript.cjs --external:tsx --external:esbuild --external:get-tsconfig --external:resolve-pkg-maps --external:dockerode --external:pdfjs-dist --external:web-tree-sitter --external:tree-sitter-wasms --external:promptfoo --external:typescript --external:@lvce-editor/ripgrep --external:gpt-3-encoder --external:mammoth --external:xlsx --external:mathjs --external:@azure/identity --external:gpt-tokenizer --external:playwright --external:@inquirer/prompts --external:jimp --external:turndown --external:vectra --external:tabletojson --external:html-to-text --external:@octokit/rest --external:@octokit/plugin-throttling --external:@octokit/plugin-retry --external:@octokit/plugin-paginate-rest --external:skia-canvas
    at genericNodeError (node:internal/errors:984:15)
    at wrappedFn (node:internal/errors:538:14)
    at checkExecSyncError (node:child_process:891:11)
    at Object.execFileSync (node:child_process:927:15)
    at Object.<anonymous> (/workspaces/genaiscript/node_modules/esbuild/bin/esbuild:220:28)
    at Module._compile (node:internal/modules/cjs/loader:1469:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1548:10)
    at Module.load (node:internal/modules/cjs/loader:1288:32)
    at Module._load (node:internal/modules/cjs/loader:1104:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:174:12) {
  status: 1,
  signal: null,
  output: [ null, null, null ],
  pid: 6965,
  stdout: null,
  stderr: null
}

Node.js v20.18.0
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
pelikhan commented 5 days ago

there are dependencies in the build; and you probably want to run "yarn compile" from the workspace root first. It is created by the bundledprompts.js script.

pelikhan commented 5 days ago

@sahuguet I've beefed up the contributing docs at https://github.com/microsoft/genaiscript/blob/main/CONTRIBUTING.md

sahuguet commented 4 days ago

Solved using new documentation.