SyntaxError: Requested module does not provide export named 'startworker' on Node.js deployment
georgeepurgy
FREEOP

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.

$10 Bounty

4 Replies

Railway
BOT

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


Does it work locally?


codecraftnexus
FREE

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';

codecraftnexus
FREE

2 hours ago

image.png

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';

codecraftnexus
FREE

2 hours ago

image.png

Attachments


Welcome!

Sign in to your Railway account to join the conversation.

Loading...