Closed GegznaV closed 1 year ago
Please see https://github.com/mtxr/vscode-sqltools/pull/993#issuecomment-1265828891 for advice. Let us know if this helps.
The issue seems to be the use of single quotes rather than double. If you change the quotes to double it executes. Edit: following that comment above does fix this, but only as a workaround. The auto detect still does not work. I am using Command Prompt
Installing PowerShell 7 and setting it as the default terminal for windows in VSCode worked for me. But does it mean that I am forced to use these settings to make the plugin work? I'd like to use Git Bash or Ubuntu WLS terminal as the default terminal.
OK, there is more in that comment. I did not use that workaround yet.
Setting to "sqltools.useNodeRuntime": "C:\\Program Files\\nodejs\\node.exe"
and using WSL terminal as default gives the same issue as in the original post.
So
But does it mean that I am forced to use these settings to make the plugin work? I'd like to use Git Bash or Ubuntu WLS terminal as the default terminal.
Today's 0.26.0 release includes changes that should make this mechanism work even without PowerShell 7. Please let us know here if this helps you.
I did not change anything, just updated the plugins (use PowerShell 7 as the default shell on the Windows side). Is this warning expected at VSCode startup?
Does this message mean to change this setting "sqltools.useNodeRuntime"
?
Can the purpose described in the message be achieved by deleting "sqltools.useNodeRuntime": "C:\\Program Files\\nodejs\\node.exe"
from settings.json
?
OK, the removal of this setting did not help to remove the warning. Please, give more explicit instructions on what to do to get rid of this warning.
0.26 with powershell 7 on macOS
PS /Users/mikes/Documents/Repos/Workflows> node -e 'require("fs").writeFileSync("/Users/mikes/Library/Application Support/vscode-sqltools/.node-runtime", process.execPath)'
[eval]:1
require(fs).writeFileSync(/Users/mikes/Library/Application
^
SyntaxError: Invalid regular expression flags
at new Script (node:vm:101:7)
at createScript (node:vm:262:10)
at Object.runInThisContext (node:vm:310:10)
at node:internal/process/execution:77:19
at [eval]-wrapper:6:22
at evalScript (node:internal/process/execution:76:60)
at node:internal/main/eval_string:23:3
PS /Users/mikes/Documents/Repos/Workflows>
@mikes-gh what version of node do you have?
node -v
@mikes-gh what version of node do you have?
node -v
v15.3.0
edit
Same error with v18.12.1
On my machine macOS powershell 7 and I suspect Linux
node -e 'require("fs").writeFileSync("/Users/mikes/Library/Application Support/vscode-sqltools/.node-runtime", process.execPath)' && $(exit 0)
Result error
node -e "require('fs').writeFileSync('/Users/mikes/Library/Application Support/vscode-sqltools/.node-runtime', process.execPath)" && $(exit 0)
Result succeed
Can someone on windows try
node -e "require('fs').writeFileSync('C:\ChangeThisToYourPath\vscode-sqltools\.node-runtime', process.execPath)" && $(exit 0)
And if it works just change.
OK, the removal of this setting did not help to remove the warning. Please, give more explicit instructions on what to do to get rid of this warning.
@GegznaV when sqltools.useNodeRuntime
is set to be a string I wouldn't expect that modal warning ever to appear. When set true
the modal will appear after 5 seconds if detection hasn't completed. I have created #1034 to increase this timeout. Until then I suggest you either tolerate it, or set the string, or get a faster workstation. 😉
Thank you for your response, @gjsjohnmurray :)
OK, the removal of this setting did not help to remove the warning. Please, give more explicit instructions on what to do to get rid of this warning.
@GegznaV when
sqltools.useNodeRuntime
is set to be a string I wouldn't expect that modal warning ever to appear. When settrue
the modal will appear after 5 seconds if detection hasn't completed. I have created #1034 to increase this timeout. Until then I suggest you either tolerate it, or set the string, or get a faster workstation. 😉
In my settings, there was null
, not logical:
"sqltools.useNodeRuntime": null
Do you mean string like this:
If yes, why does the warning appear?
Until then I suggest you either tolerate it
No problem :)
For me, the initial issue is solved. So, in my opinion, the thread can be closed.
Just I'm not sure about @mikes-gh's issue: is it solved too? Is it the same issue?
@GegznaV in the JSON in your screenshot the word sqltools
has squiggles under it. Do you get a tip when you hover over the word? Which settings file is this in?
I don't know why null
is also an accepted value for this setting. @mtxr may do.
Just I'm not sure about @mikes-gh's issue: is it solved too? Is it the same issue?
That's different. I created #1036 for it.
JSON in your screenshot the word
sqltools
has squiggles under it.
It is a spellchecker:
I don't know why
null
is also an accepted value for this setting.
I deleted the row from the settings, and the one with null
was auto-generated.
Which settings file is this in?
Ctrl+Shift+P then:
Do you have a workspace open? If yes there will also be a command Preferences: Open Workspace Settings (JSON)
. Please run that and check whether you have any sqltools
settings in it.
In "sqltools.useNodeRuntime": "C:\\Program Files\\nodejs\\node.exe"
there was a logical value. I fixed it into character and the issue got fixed. Thank you, @gjsjohnmurray :)
Describe the bug Error occurs if nodeJS runtime is enabled.
To Reproduce Steps to reproduce the behavior: 1.Set
"sqltools.useNodeRuntime": true
The list of currently set connections is not present![image](https://user-images.githubusercontent.com/12725868/198139634-ef1c811e-9da5-4228-9673-2871dde14a50.png)
After pushing "Add New Connection" and a pal period (e.g., 1 min.) additional error occurs as a pop-up:![image](https://user-images.githubusercontent.com/12725868/198140569-f8d2970b-bcff-46af-9c46-07c418bef4ab.png)
Expected behavior No error, fully functional SQLTools extension.
Desktop (please complete the following information):
Additional context This issue appeared when I tried to connect to an SQLite database.