SeleniumHQ / selenium-ide

Open Source record and playback test automation for the web.
https://selenium.dev/selenium-ide/
Apache License 2.0
2.73k stars 740 forks source link

selenium-side-runner throw "MODULE_NOT_FOUND" error when user folder on Windows has space character #1739

Closed vonguyenminhtu2504 closed 7 months ago

vonguyenminhtu2504 commented 7 months ago

🐛 Bug Report

I ran this command in Windows PowerShell v5.1. Here is the whole terminal text:

Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.

Install the latest PowerShell for new features and improvements! https://aka.ms/PSWindows

PS C:\Users\MinhTu VoNguyen\Desktop> selenium-side-runner ".\test.side"
node:internal/modules/cjs/loader:1080
  throw err;
  ^

Error: Cannot find module 'C:\Users\MinhTu'
    at Module._resolveFilename (node:internal/modules/cjs/loader:1077:15)
    at Module._load (node:internal/modules/cjs/loader:922:27)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:86:12)
    at node:internal/main/run_main_module:23:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}

Node.js v18.18.1
PS C:\Users\MinhTu VoNguyen\Desktop>

To Reproduce

Run the command on a Windows device that has space characters in the User folder.

Expected behavior

The command can run with special characters in the path.

Project file reproducing this issue (highly encouraged)

I think it is not necessary.

Environment

OS: Windows 11 23H2 Selenium IDE Version: 3.17.2 Selenium SIDE Runner Version: 4.0.0-alpha.61 Node version: v18.18.1 Browser Version: 119.0.6045.200 (Official Build) (64-bit)

toddtarsi commented 7 months ago

Thanks for reporting! I'm not so sure what to do here unfortunately. I only have a mac, and I tested from a directory with a space, and the test ran fine. I don't see the stack trace even crossing the application at any point either, just a bunch of lines from node:internal. To some degree, I feel like I'm not confident this even involves selenium-side-runner.

For example, it closely matches this error someone talked about getting for react-scripts:

https://stackoverflow.com/questions/77147461/error-cannot-find-module-c-users-my-pc-onedrive-desktop-react-scripts-bin-rea

Here are some people talking about this in node core:

https://github.com/nodejs/help/issues/2644

It seems like the special characters thing is more of a core nodejs issue than a selenium-side-runner issue, and I'm not at the level of fixing issues in the base language runner.

toddtarsi commented 7 months ago

I'm going to close this issue for now. Please feel free to re-open if you uncover some details of where this tool is mis-configured. I'm just not really able to help here unfortunately :(

github-actions[bot] commented 6 months ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.