Skip to content

ES Module step implementations do not work #750

@VororRich

Description

@VororRich

Describe the bug
Step implementations using ES Module format (import instead of require, etc) cause an error at runtime.

To Reproduce
Steps (or project) to reproduce the behavior:

  1. Clone this repo
  2. cd examples
  3. Run gauge run
  4. See error
Line 8: Unexpected token     <=== "import" (step_implementation.js)
Line 10: Unexpected token    <=== "export" (vowels.js)

Logs

13-01-2026 17:43:19.728 [Gauge] [DEBUG] Started concepts parsing.
13-01-2026 17:43:19.729 [Gauge] [DEBUG] 0 concepts parsing completed.
13-01-2026 17:43:19.729 [Gauge] [DEBUG] Started specifications parsing.
13-01-2026 17:43:19.729 [Gauge] [DEBUG] 1 specifications parsing completed.
13-01-2026 17:43:19.729 [Gauge] [DEBUG] Parsing completed.
13-01-2026 17:43:19.942 [js] [ERROR] Line 8: Unexpected token
13-01-2026 17:43:19.943 [js] [ERROR] Line 10: Unexpected token
13-01-2026 17:43:19.953 [Gauge] [DEBUG] Attempting to connect to grpc server at port: 65033
13-01-2026 17:43:19.953 [Gauge] [DEBUG] Successfully made the connection with runner with port: 65033
13-01-2026 17:43:19.953 [Gauge] [DEBUG] Validation started.

Expected behavior
Node vm should be loading step implementations as ES Module files, not Common JS

Screenshots

Image

Versions:

  • Node.js 22.20.0
Gauge version: 1.6.22
Commit Hash: 7ea39af

Plugins
-------
html-report (4.4.0)
js (5.0.1)
screenshot (0.3.2)

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions