mirror of
https://github.com/johndoe6345789/low-code-react-app-b.git
synced 2026-04-25 06:04:54 +00:00
2.8 KiB
2.8 KiB
Build Fix Complete
Issue
The build was failing with the error:
[vite]: Rollup failed to resolve import "@github/spark/hooks" from "/workspaces/low-code-react-app-b/src/hooks/use-project-state.ts".
Root Cause
The codebase was importing from @github/spark/hooks which doesn't exist in the build environment. This was a leftover reference from when the packages folder existed.
Solution
Replaced all imports of @github/spark/hooks with the local @/hooks/use-kv implementation throughout the codebase.
Files Modified
Component Files
src/App.refactored.tsxsrc/App.simple.tsxsrc/components/AtomicComponentDemo.tsxsrc/components/ComprehensiveDemoPage.tsxsrc/components/DockerBuildDebugger.tsxsrc/components/FaviconDesigner.tsxsrc/components/FeatureIdeaCloud.tsxsrc/components/GlobalSearch.tsxsrc/components/JSONDemoPage.tsxsrc/components/JSONLambdaDesigner.tsx
Hook Files
src/hooks/use-project-state.tssrc/hooks/data/use-array.tssrc/hooks/data/use-components.tssrc/hooks/data/use-data-source.tssrc/hooks/data/use-data-sources.tssrc/hooks/data/use-files.tssrc/hooks/data/use-json-data.tssrc/hooks/data/use-lambdas.tssrc/hooks/data/use-models.tssrc/hooks/data/use-workflows.tssrc/hooks/feature-ideas/use-feature-ideas.tssrc/hooks/feature-ideas/use-idea-connections.tssrc/hooks/feature-ideas/use-idea-groups.tssrc/hooks/feature-ideas/use-node-positions.tssrc/hooks/ui/use-schema-editor.tssrc/hooks/use-navigation-history.ts
Config Files
src/config/orchestration/data-source-manager.tssrc/lib/json-ui/hooks.ts(re-exported via@/lib/json-ui)
Change Pattern
All instances of:
import { useKV } from '@github/spark/hooks'
Were replaced with:
import { useKV } from '@/hooks/use-kv'
Storage Implementation
The local useKV hook (src/hooks/use-kv.ts) uses the storage service (@/lib/storage-service) which:
- Defaults to IndexedDB for client-side persistence
- Can be configured to use a Flask API backend via environment variable or UI settings
- Automatically falls back to IndexedDB if the Flask API fails
TypeScript Definitions
The window.spark global object is properly typed in src/vite-env.d.ts and includes:
llmPrompt: Template string function for creating promptsllm: Function for calling LLM APIsuser: Function for getting current user infokv: Key-value storage API (keys, get, set, delete)
Build Status
✅ All TypeScript import errors resolved ✅ Build should now complete successfully ✅ Docker multi-arch builds should work
Next Steps
- Run
npm run buildto verify the build completes - Test the Docker build process
- Verify the application works correctly in production