-
Notifications
You must be signed in to change notification settings - Fork 4
Description
Description
On a fresh clone / fresh ./bin/start.sh, starting the platform or building plugin frontends can fail because internal workspace packages are imported from their compiled dist/ outputs, but those outputs are not built yet.
This shows up as Vite failing to load plugin vite.config.ts (which imports @naap/plugin-build/vite) and base-svc failing to start importing @naap/cache.
Environment
- OS: Linux
- Node:
v23.11.1(likely affects Node 20+ as well) - npm:
10.9.x
Steps to Reproduce
- Fresh clone repo
- Run ./bin/start.sh
Actual Behavior
Plugin frontend builds fail with missing module errors, e.g.:
failed to load config from .../plugins/marketplace/frontend/vite.config.ts
Error [ERR_MODULE_NOT_FOUND]: Cannot find module '.../node_modules/@naap/plugin-build/dist/vite.js'
Also base-svccan fail with:
Error [ERR_MODULE_NOT_FOUND]: Cannot find module '.../node_modules/@naap/cache/dist/index.js'
Expected Behavior
Fresh install should be able to build plugins and start services without manually prebuilding internal workspace packages.
Workaround
Manually build the internal workspace packages first:
npm run build --workspace=@naap/plugin-build
npm run build --workspace=@naap/cacheAfter that, ./bin/start.sh proceeds and plugins build successfully.
Suspected Cause
Internal workspace packages packages/plugin-build, packages/cache publish exports/main pointing to dist/*, but there is no guaranteed bootstrap step (e.g. root postinstall / prepare / start script preflight) to compile them before they’re consumed by Vite/tsx.
Proposed Fix
Any of the following would resolve it:
- Add a root-level bootstrap step (recommended):
postinstallscript that runs a minimal build for required internal packages:npm run build --workspace=@naap/plugin-buildnpm run build --workspace=@naap/cache
- Or update bin/start.sh preflight / plugin build checks to ensure these are built before attempting plugin builds / service startup.
Additional Notes
- bin/build-plugins.sh already includes logic to build @naap/plugin-build if
dist/vite.jsis missing, but the failing path can happen outside that script (direct workspace builds / start flow).
Metadata
Metadata
Assignees
Labels
Type
Projects
Status