Skip to content
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

[🐛 Bug]: pkg to exe #15286

Open
cong2535 opened this issue Feb 14, 2025 · 2 comments
Open

[🐛 Bug]: pkg to exe #15286

cong2535 opened this issue Feb 14, 2025 · 2 comments

Comments

@cong2535
Copy link

What happened?

Error: Failed to import atoms module get-attribute.js. If running in dev mode, you need to run bazel build //javascript/node/selenium-webdriver/lib/atoms:get-attribute.js from the projectroot: Error: Cannot find module './atoms/get-attribute.js'
Require stack:

  • C:\snapshot\selenium-node\node_modules\selenium-webdriver\lib\http.js
  • C:\snapshot\selenium-node\node_modules\selenium-webdriver\http\index.js
  • C:\snapshot\selenium-node\node_modules\selenium-webdriver\index.js
  • C:\snapshot\selenium-node\index.js
  1. If you want to compile the package/file into executable, please pay attention to compilation warnings and specify a literal in 'require' call. 2) If you don't want to compile the package/file into executable and want to 'require' it from filesystem (likely plugin), specify an absolute path in 'require' call using process.cwd() or process.execPath.
    at requireAtom (C:\snapshot\selenium-node\node_modules\selenium-webdriver\lib\http.js:58:13)
    at Object. (C:\snapshot\selenium-node\node_modules\selenium-webdriver\lib\http.js:39:22)
    at Module._compile (pkg/prelude/bootstrap.js:1926:22)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at Module.require (pkg/prelude/bootstrap.js:1851:31)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object. (C:\snapshot\selenium-node\node_modules\selenium-webdriver\http\index.js:29:17)

How can we reproduce the issue?

try{

  const { Builder, Browser, By, Key, until } = require('selenium-webdriver')

  ;(async function example() {
    let driver = await new Builder().forBrowser(Browser.EDGE).build()
    try {
      await driver.get('https://www.baidu.com')
      await new Promise((resolve) => {
        setTimeout(() => {
          resolve()
        }, 3000)
      })
    }finally {
      await driver.quit()
    }
  })()
}catch (e) {
  console.log(e)
}

Relevant log output

Error: Failed to import atoms module get-attribute.js. If running in dev mode, you need to run `bazel build //javascript/node/selenium-webdriver/lib/atoms:get-attribute.js` from the projectroot: Error: Cannot find module './atoms/get-attribute.js'
Require stack:
- C:\snapshot\selenium-node\node_modules\selenium-webdriver\lib\http.js
- C:\snapshot\selenium-node\node_modules\selenium-webdriver\http\index.js
- C:\snapshot\selenium-node\node_modules\selenium-webdriver\index.js
- C:\snapshot\selenium-node\index.js
1) If you want to compile the package/file into executable, please pay attention to compilation warnings and specify a literal in 'require' call. 2) If you don't want to compile the package/file into executable and want to 'require' it from filesystem (likely plugin), specify an absolute path in 'require' call using process.cwd() or process.execPath.
    at requireAtom (C:\snapshot\selenium-node\node_modules\selenium-webdriver\lib\http.js:58:13)
    at Object.<anonymous> (C:\snapshot\selenium-node\node_modules\selenium-webdriver\lib\http.js:39:22)
    at Module._compile (pkg/prelude/bootstrap.js:1926:22)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at Module.require (pkg/prelude/bootstrap.js:1851:31)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (C:\snapshot\selenium-node\node_modules\selenium-webdriver\http\index.js:29:17)

Operating System

win11

Selenium version

javascript

What are the browser(s) and version(s) where you see this issue?

edge

What are the browser driver(s) and version(s) where you see this issue?

edge

Are you using Selenium Grid?

No response

Copy link

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


Info for maintainers

Triage this issue by using labels.

If information is missing, add a helpful comment and then I-issue-template label.

If the issue is a question, add the I-question label.

If the issue is valid but there is no time to troubleshoot it, consider adding the help wanted label.

If the issue requires changes or fixes from an external project (e.g., ChromeDriver, GeckoDriver, MSEdgeDriver, W3C), add the applicable G-* label, and it will provide the correct link and auto-close the issue.

After troubleshooting the issue, please add the R-awaiting answer label.

Thank you!

@Balaji028
Copy link

Hi @cong2535 , I tried reproducing the issue in windows 10 Machine using Edge browser , but not able to see any issue related to Bazel in output terminal as you mentioned , Edge browser session got created and navigating to URL .The URL which you mentioned in the issue is not available .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants