✅ Development Mode: Real blockchain transactions work perfectly ❌ Production Build: Lucid-cardano library fails to load
Lucid-cardano has dependencies (WASM modules, Node.js polyfills) that don't bundle well with Vite for production builds. This is a known limitation of using Lucid in browser-based applications.
Failed to import lucid-cardano: TypeError: Failed to resolve module specifier 'lucid-cardano'
For real blockchain transactions, run the app in development mode:
# Clone the repository
git clone https://github.com/Campverse/TrustlessTask.git
cd TrustlessTask
# Install dependencies
npm install
# Run in development mode
npm run devThen access at http://localhost:5173
Why this works:
- Vite's dev server handles ES modules correctly
- WASM modules load properly
- All Cardano wallet integrations function
- Real blockchain transactions execute successfully
Consider migrating to production-friendly alternatives:
-
@meshsdk/core - Better production build support
npm install @meshsdk/core @meshsdk/react
-
cardano-serialization-lib - Direct use without Lucid wrapper
npm install @emurgo/cardano-serialization-lib-browser
-
Backend Transaction Building - Move transaction logic to Node.js backend
- Frontend only handles wallet connection
- Backend builds and submits transactions
- More secure and production-ready
The Vercel deployment runs in demo mode:
- ✅ Full UI/UX works
- ✅ Wallet detection works
- ✅ All pages responsive and functional
- ❌ Real transactions disabled
- ℹ️ Shows informative error messages
- Use development mode for testing real transactions
- Vercel deployment showcases UI/UX
- Document the limitation clearly
-
Migrate to MeshSDK
- Better Vite/production support
- Active maintenance
- Similar API to Lucid
-
Backend Transaction Service
- More secure (private keys never in browser)
- Better error handling
- Production-ready architecture
-
Hybrid Approach
- Frontend: Wallet connection + signing
- Backend: Transaction building + submission
- Best of both worlds
- Tried various rollup options
- Attempted manual chunking
- Added polyfills
- Result: Build still fails
- Aliased stream-browserify
- Added readable-stream
- Result: Circular dependency issues
- Marked lucid as external
- Result: Module not found in browser
| Feature | Development | Production (Vercel) |
|---|---|---|
| UI/UX | ✅ Works | ✅ Works |
| Wallet Detection | ✅ Works | ✅ Works |
| Wallet Connection | ✅ Works | ✅ Works |
| Transaction Building | ✅ Works | ❌ Fails |
| Transaction Submission | ✅ Works | ❌ Fails |
| Mobile Responsive | ✅ Works | ✅ Works |
-
Clone and run locally:
git clone https://github.com/Campverse/TrustlessTask.git cd TrustlessTask npm install npm run dev -
Install a Cardano wallet:
- Nami: https://namiwallet.io/
- Lace: https://www.lace.io/
- Eternl: https://eternl.io/
-
Get testnet ADA:
-
Test transactions:
- Create a project
- Mark milestone complete (sends 1 ADA)
- Approve and release funds (sends milestone amount)
- WASM Modules: Lucid uses WebAssembly that Vite struggles to bundle
- Node.js Dependencies: Requires fs, path, crypto polyfills
- Dynamic Imports: Module resolution fails in bundled code
- ESM/CommonJS Mix: Dependency tree has mixed module formats
lucid-cardano
├── @emurgo/cardano-serialization-lib-browser (WASM)
├── node-fetch (Node.js APIs)
├── fetch-blob
│ └── stream-browserify/web (doesn't exist)
└── Various other Node.js dependencies
For Production Use:
- Migrate to MeshSDK or backend transaction service
- Current Vercel deployment is UI/UX showcase only
For Development/Testing:
- Use
npm run devfor full functionality - All blockchain features work perfectly
Current Status:
- ✅ Mobile responsive design complete
- ✅ All UI components working
- ✅ Wallet integration functional
⚠️ Real transactions require development mode- 📋 Production blockchain solution pending migration
- MeshSDK: https://meshjs.dev/
- Cardano Serialization Lib: https://github.com/Emurgo/cardano-serialization-lib
- Lucid Issues: https://github.com/spacebudz/lucid/issues
- Vite Browser Compatibility: https://vite.dev/guide/troubleshooting.html
For questions about implementing production blockchain transactions, please open an issue on GitHub.