Skip to content

fix: move esbuild to dependencies so pi install can run the prepare script - #6

Open
matthewryanscott wants to merge 1 commit into
Michaelliv:mainfrom
matthewryanscott:fix/esbuild-dependency
Open

fix: move esbuild to dependencies so pi install can run the prepare script#6
matthewryanscott wants to merge 1 commit into
Michaelliv:mainfrom
matthewryanscott:fix/esbuild-dependency

Conversation

@matthewryanscott

Copy link
Copy Markdown

When installing via pi install, the command runs npm install --omit=dev, which skips devDependencies. The prepare lifecycle script invokes npm run build:runtime, which calls build.mjs — and that script imports esbuild.

Since esbuild is only in devDependencies, it's not available during pi install, causing the build to fail:

> pi-generative-ui@0.3.0 prepare
> npm run build:runtime

> pi-generative-ui@0.3.0 build:runtime
> node .pi/extensions/generative-ui/build.mjs

Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'esbuild' imported from
  .../pi-generative-ui/.pi/extensions/generative-ui/build.mjs

This moves esbuild from devDependenciesdependencies so it's available at install time when pi runs npm install --omit=dev.

I'm offering this as the fix that worked for me, but totally understand if there's a better approach—happy for this to be rejected in favor of a cleaner solution.

(LLM-assisted PR)

esbuild is required at install time by the prepare script (npm run build:runtime).
Since pi install runs npm install --omit=dev, devDependencies are not available,
causing the build to fail. Moving esbuild to dependencies ensures it's present.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant