Skip to content

WDIO V9 BrowserstackLocal - import is not allowed in NODE_OPTIONS #121

Description

@Naveen-App

WebdriverIO Version
9.27.1

Node.js Version
24.13.0

Which capabilities are you using?
"@wdio/appium-service": "9.27.1",
"@wdio/browserstack-service": "9.27.1",
"@wdio/cli": "9.27.1",
"@wdio/local-runner": "9.27.1",
"@wdio/mocha-framework": "9.27.1",
"@wdio/spec-reporter": "9.27.1",
"ts-node": "10.9.2",
"tsconfig-paths": "4.2.0",
"typescript": "6.0.3",

What happened?
When upgrade webdriverio v8 to v9, During local execution with browserstack is working fine, not getting any error.

When running WebdriverIO tests with the BrowserStack service, the BrowserStackLocal binary fails to start due to NODE_OPTIONS being set, resulting in the following error:

/root/.browserstack/BrowserStackLocal: --import is not allowed in NODE_OPTIONS

This causes repeated failures to start the local tunnel, and the test run cannot proceed.

Details
Command executed:
/root/.browserstack/BrowserStackLocal --daemon start --log-file ... --key ... --force-local --local-identifier ... --skipBinaryInitialisation false

Error Ouptut:
/root/.browserstack/BrowserStackLocal: --import is not allowed in NODE_OPTIONS

Stack trace:
Error while trying to execute binary: Error: Command failed: /root/.browserstack/BrowserStackLocal ...
at ChildProcess.exithandler (node:child_process:422:12)

What is your expected behavior?
WebdriverIO should ensure NODE_OPTIONS is unset when spawning the BrowserStackLocal binary, or provide a configuration option to do so.

How to reproduce the bug.
Upgrade v9 version with mentioned capabilities.

Relevant log output
/root/.browserstack/BrowserStackLocal: --import is not allowed in NODE_OPTIONS

I have raised the issue on webdriverio repo, they have routed to raise the issue on this repo.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions