Skip to content

[🐛 Bug]: cannot import remote subpackage in ESM project #15670

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Jamesgt opened this issue Apr 25, 2025 · 2 comments
Open

[🐛 Bug]: cannot import remote subpackage in ESM project #15670

Jamesgt opened this issue Apr 25, 2025 · 2 comments
Labels
A-needs-triaging A Selenium member will evaluate this soon! B-grid Everything grid and server related C-nodejs JavaScript Bindings D-chrome I-defect Something is not working as intended OS-windows

Comments

@Jamesgt
Copy link

Jamesgt commented Apr 25, 2025

Description

In my ESM Typescript project when I try to import FileDetector from 'selenium-webdriver/remote' I receive Cannot find module 'selenium-webdriver/remote' or its corresponding type declarations.ts(2307)
If I try to use dynamic import I get runtime error. ERR_UNSUPPORTED_DIR_IMPORT as you are not exporting subpackages.
I'm using tsconfig:
{
"module": "Node16",
"moduleResolution": "node16",
}

Reproducible Code

import { FileDetector } from 'selenium-webdriver/remote'
@Jamesgt Jamesgt added A-needs-triaging A Selenium member will evaluate this soon! I-defect Something is not working as intended labels Apr 25, 2025
@github-actions github-actions bot added B-grid Everything grid and server related C-nodejs JavaScript Bindings D-chrome OS-windows labels Apr 25, 2025
@Jamesgt
Copy link
Author

Jamesgt commented Apr 25, 2025

I think the solution might be simple like here microsoft/TypeScript#52363 (comment) just I'm not familiar how to solve it when you have types separately in @types namespace.

@selenium-ci
Copy link
Member

@Jamesgt, thank you for creating this issue. We will troubleshoot it as soon as we can.

Selenium Triage Team: remember to follow the Triage Guide

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-needs-triaging A Selenium member will evaluate this soon! B-grid Everything grid and server related C-nodejs JavaScript Bindings D-chrome I-defect Something is not working as intended OS-windows
Projects
None yet
Development

No branches or pull requests

2 participants