You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
set up window, document, etc. on global using a JSDOM instance
Do not have a stealconfig.js in your root dir
call steal.startup() with a main defined but no configMain
Expected results:
no error,
configMain in the steal instance is set to "package.json!npm" (which is consistent with what happens on MacOS or Linux platforms)
Actual results:
process exits with the following error
[Error: ENOENT: no such file or directory, open '<drive>:\<path to project>\stealconfig.js'] {
errno: -4058,
code: 'ENOENT',
syscall: 'open',
path: '<drive>:\\<path to project>\\stealconfig.js',
statusCode: 404,
url: 'file:<drive>:/<path to project>/stealconfig.js'
}
if breaking in with a debugger before the error, configMain is set to stealConfig.js
Deep analysis:
steal/main.js line 2241: getUrlOptions() sets a default stealPath to __dirname, which uses backslashes on windows
this is a problem when we get to specialConfig.stealPath.set(), line 1995 or so, because parts has been created by splitting dirname (which is envPath(stealPath)) on "/", line 1971. This makes the test after isNode fail because it's not getting the last path element correctly
There's only two places I see backslashes being replaced with forward slashes:
function core(), line 2683, where an isWindows check and a (not working check due to us setting window on global) is setting baseUri
toAbsoluteURL line 2503 where it will change the href before reconstructing and returning it
so isWindows is declared both on lines 2467 and 4737. that doesn't cover either of the scopes where it may be needed.
I think it comes down to fixing the appropriate source files. I just don't know
In the meantime, setting configMain manually to "package.json!npm" when configuring should provide a workaround.
Environment:
Software
Version
Steal version
2.3.0
Steal-tools version
N/A
node -v
14.21.2
npm -v
6.14.17
Browser
JSDOM
Operating system
Windows 10
The text was updated successfully, but these errors were encountered:
How often can you reproduce it?
Description:
Steps to reproduce:
In a node process,
Expected results:
Actual results:
stealConfig.js
Deep analysis:
steal/main.js line 2241: getUrlOptions() sets a default stealPath to __dirname, which uses backslashes on windows
this is a problem when we get to specialConfig.stealPath.set(), line 1995 or so, because parts has been created by splitting dirname (which is envPath(stealPath)) on "/", line 1971. This makes the test after isNode fail because it's not getting the last path element correctly
There's only two places I see backslashes being replaced with forward slashes:
so isWindows is declared both on lines 2467 and 4737. that doesn't cover either of the scopes where it may be needed.
I think it comes down to fixing the appropriate source files. I just don't know
In the meantime, setting configMain manually to "package.json!npm" when configuring should provide a workaround.
Environment:
The text was updated successfully, but these errors were encountered: