#126

`pnpm dev` throws `Could not resolve "../../../lib/codegen-registry"`

Openhomanpopened 11mo ago

Description

Trying to run pnpm dev throws:

Discovering plugins...
Found 12 plugin(s):
   - ai-gateway
   - blob
   - fal
   - firecrawl
   - github
   - linear
   - perplexity
   - resend
   - slack
   - stripe
   - superagent
   - v0

Generating plugins/index.ts...
Updating README.md...
No integrations found, skipping README update
Generating lib/types/integration.ts...
Generated lib/types/integration.ts with 1 type(s)
Generating lib/step-registry.ts...
Generated lib/step-registry.ts with 0 step(s)
Generating lib/output-display-configs.ts...
Generated lib/output-display-configs.ts with 0 config(s)

Processing step files for codegen templates...
Generating lib/codegen-registry.ts...
No codegen templates generated
Done! Plugin registry updated.

[baseline-browser-mapping] The data in this module is over two months old.  To ensure accurate Baseline data, please update: `npm i baseline-browser-mapping@latest -D`
(node:89626) ExperimentalWarning: Importing JSON modules is an experimental feature and might change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
Discovering workflow directives 486ms
✘ [ERROR] Could not resolve "../../../lib/codegen-registry"

    components/workflow/utils/code-generators.ts:3:45:
      3 │  */ import { AUTO_GENERATED_TEMPLATES } from "../../../lib/codegen-registry";
        ╵                                              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Error: Build failed with 1 error:
components/workflow/utils/code-generators.ts:3:45: ERROR: Could not resolve "../../../lib/codegen-registry"
    at new Promise (<anonymous>) {
  errors: [Array],
  warnings: []
}
[baseline-browser-mapping] The data in this module is over two months old.  To ensure accurate Baseline data, please update: `npm i baseline-browser-mapping@latest -D`
(node:89620) ExperimentalWarning: Importing JSON modules is an experimental feature and might change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
Discovering workflow directives 421ms
✘ [ERROR] Could not resolve "../../../lib/codegen-registry"

    components/workflow/utils/code-generators.ts:3:45:
      3 │  */ import { AUTO_GENERATED_TEMPLATES } from "../../../lib/codegen-registry";

Activity

3
temprlbusiness11mo ago

I found the issue that when they pushed the code in .gitignore they have added codegen-registry.tsx which excluded when pushing to github .

homanp11mo ago

I found the issue that when they pushed the code in .gitignore they have added codegen-registry.tsx which excluded when pushing to github .

seems correct yes

nomorechokedboy8mo ago

This is because the package.json is missing "type": "module". Because of this. Tsx treat the discover-plugins.ts script as CJS, not ESM. Hence, it can't resolve the alias @. You just need to add

 "type": "module",

to the package.json and then you can run pnpm dev without the error