3 hours ago
Hi team,
I am deploying a Node.js Deriv trading bot to Railway from GitHub. During container startup, the deployment crashes with the following error:
SyntaxError: The requested module './worker.js' does not provide an export named 'startworker'
at #asyncInstantiate (node:internal/modules/esm/module_job:455:21)
Context & Setup:
- Environment: Node.js v24.20.0
- Entry point: index.js running
node index.js - Files: index.js, worker.js, config.js located at the repository root.
- Environment variables (TRADING_MODE, DERIV_TOKEN, etc.) have been configured in the Railway dashboard.
I am looking for guidance on resolving this ESM module export resolution error during deployment.
4 Replies
3 hours ago
This thread has been opened as a bounty so the community can help solve it.
Status changed to Open Railway • about 3 hours ago
3 hours ago
// In worker.js, make sure to export the function:
export function startworker() {
// Your worker logic here}
And ensure your index.js imports it correctly:
import { startworker } from './worker.js';
codecraftnexus
// In worker.js, make sure to export the function: export function startworker() { // Your worker logic here } And ensure your index.js imports it correctly: import { startworker } from './worker.js';
2 hours ago
Attachments
codecraftnexus
// In worker.js, make sure to export the function: export function startworker() { // Your worker logic here } And ensure your index.js imports it correctly: import { startworker } from './worker.js';
2 hours ago
Attachments
