Issue: Unable to Run Project Locally or Deploy to Vercel Due to Multiple Dependency and Build Errors
Summary
I’m experiencing multiple blocking issues trying to run the Deriv app locally and deploy it to Vercel. Despite following the project documentation, I encounter Node.js version conflicts, dependency resolution errors, and TypeScript compilation failures.
Environment
-
Local OS: Ubuntu 24.04
-
Node.js: Tried both v18.20.8 and v24.11.1
-
npm: v10.8.2 (with Node 18) / v11.6.2 (with Node 24)
-
Project: Cloned the deriv-app repository
Current Status
I’ve successfully installed Node 18.20.8 as required by the project dependencies, but continue to encounter critical errors when trying to run or build the application.
Detailed Problems Encountered
1. Vercel Deployment Failure
Error: Node.js Version "18.x" is discontinued and must be upgraded. Please set "engines": { "node": "24.x" } in your `package.json` file
Attempted Fix: Updated package.json to specify Node 24, but this conflicts with local requirements.
2. Local Dependency Conflicts
When running npm install with Node 18:
-
EBADENGINEwarnings for@deriv-com/analytics@1.4.13requiring npm 9.x (I have npm 10.8.2) -
Multiple deprecated package warnings
-
Peer dependency conflicts with postcss versions
3. Missing Development Script
npm error Missing script: "dev"
The documentation mentions npm run serve but the exact way to start development servers is unclear.
4. TypeScript Compilation Error
When attempting to run the bot-web-ui:
TSError: ⨯ Unable to compile TypeScript:
../../../../../../usr/share/nodejs/commander/lib/error.js(37,43): error TS2345:
Argument of type 'string | undefined' is not assignable to parameter of type 'string'.
This appears to be a compatibility issue between TypeScript and the commander library.
5. Monorepo Script Confusion
Running npm run start attempts to start all 26+ packages, many of which fail due to missing scripts or test configurations.
Steps I’ve Taken
-
Followed Quick Start Guide:
-
Cloned the deriv-app repository
-
Ran
npm run bootstrap -
Attempted
npm run build:all
-
-
Tried Multiple Node Versions:
-
Node 24.11.1 (for Vercel compatibility)
-
Node 18.20.8 (for local dependency compatibility)
-
-
Attempted Various Start Methods:
npm run serve core npx nx run @deriv/bot-web-ui:serve cd packages/bot-web-ui && npm run serve -
Cleaned and Reinstalled:
-
Multiple
rm -rf node_modulesandnpm install --legacy-peer-deps -
Cleared npm and ts-node caches
-
Specific Questions
-
Node Version Confusion: The project dependencies require Node 18.x, but Vercel rejects Node 18. What’s the recommended approach for deployment?
-
Running bot-web-ui Independently: Is it possible to run the bot-web-ui package alone, without starting the entire monorepo? If so, what are the exact steps to set it up and run it locally? The documentation mentions running
npm run serve bot-web-uialongsidenpm run serve core, but I’m encountering TypeScript errors when attempting this. -
TypeScript Error: How should I resolve the commander library TypeScript compatibility issue that prevents webpack from starting?
-
Vercel Deployment: Are there specific configuration files needed for deploying a monorepo to Vercel? What adjustments are required to the
vercel.jsonor build settings? -
Integration with Existing Next.js Project: I’m considering integrating the bot-web-ui (or its components) into an existing Next.js application. Is it feasible to:
-
Merge the bot-web-ui functionality into a single Next.js codebase (not as a monorepo)?
-
Use the
@deriv/componentspackage directly in a Next.js application?
Or would I need to run two separate applications and have them communicate? What is the recommended approach for integrating the Deriv bot interface into another application?
-
Current Error Logs
When Trying to Serve bot-web-ui:
> npx nx run @deriv/bot-web-ui:serve
> @deriv/bot-web-ui@1.0.0 serve
> echo "Serving..." && NODE_OPTIONS='-r ts-node/register' webpack --progress --watch
Serving...
/home/el/Documents/deriv-app/node_modules/ts-node/src/index.ts:859
return new TSError(diagnosticText, diagnosticCodes, diagnostics);
^
TSError: ⨯ Unable to compile TypeScript:
../../../../../../usr/share/nodejs/commander/lib/error.js(37,43): error TS2345:
Argument of type 'string | undefined' is not assignable to parameter of type 'string'.
When Running npm install:
Multiple warnings about:
-
Unsupported engine for
@deriv-com/analytics -
48 vulnerabilities (40 moderate, 8 high)
-
Numerous deprecated packages
Configuration Files Present
-
nx.json(Nx workspace configuration) -
lerna.json(monorepo management) -
vercel.json(basic Vercel config) -
Multiple TypeScript configurations
Request for Help
Could someone please provide:
-
Clear, step-by-step instructions for running the bot-web-ui locally
-
Guidance on resolving the TypeScript/commander compatibility issue
-
Best practices for deploying this monorepo to Vercel
-
Clarification on whether bot-web-ui can run independently and how
-
Advice on integrating with an existing Next.js application vs. maintaining separate applications
I’m happy to test any suggested solutions and provide additional information as needed.