VUE 3 - weird failure in VS Code and flawless running in console - visual-studio-code

Windows 10 x64 21H2, running my project in VS Code and get the following error:
Executing task: npm run serve
> weatherApp#0.1.0 serve
> vue-cli-service serve
Browserslist: caniuse-lite is outdated. Please run:
npx browserslist#latest --update-db
Why you should do it regularly: https://github.com/browserslist/browserslist#browsers-data-updating
INFO Starting development server...
10% building 2/5 modules 3 active ...babel-loader\lib\index.js!C:\tmp\VUE Weather apps\VUE 3 - weather\node_modules\eslint-loader\index.js??ref--13-0!C:\tmp\VUE Weather apps\VUE 3 - weather\src\main.jsError: error:0308010C:digital envelope routines::unsupported
at new Hash (node:internal/crypto/hash:71:19)
at Object.createHash (node:crypto:133:10)
at module.exports (C:\tmp\VUE Weather apps\VUE 3 -
...
{
opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
library: 'digital envelope routines',
reason: 'unsupported',
code: 'ERR_OSSL_EVP_UNSUPPORTED'
}
Node.js v18.12.1
* The terminal process "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -Command npm run serve" terminated with exit code: 1.
* Terminal will be reused by tasks, press any key to close it.
At the same time the command npm run serve runs w/o any issues. What should I do to have the issue fixed?

Related

Commands not recognised in GitHub Action Mocha tests

My unit tests pass when run locally. When executed by a GitHub Action when a branch is committed, this action
on:
push:
branches:
- '*' # matches every branch that doesn't contain a '/'
- '*/*' # matches every branch containing a single '/'
- '**' # matches every branch
- '!master' # excludes master
workflow_dispatch:
inputs:
build:
description: Unit tests
type: boolean
required: true
default: "true"
jobs:
build:
strategy:
matrix:
os: [windows-latest]
# os: [ubuntu-latest, windows-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout#v2
- name: Install Node.js
uses: actions/setup-node#v1
with:
node-version: 16.x
- run: npm install
- run: npm i gulp gulp-cli -g
if: runner.os == 'MacOS'
- run: gulp
- run: xvfb-run -a npm test
if: runner.os == 'Linux'
- run: npm test
if: runner.os != 'Linux'
basically runs npm test.
When I do that locally, it works fine:
npm test
> vscode-print#0.9.25 test
> node ./out/test/runTest.js
Debugger listening on ws://127.0.0.1:63067/252bd7f9-c748-45b4-b9e6-8ba21e9fc909
For help, see: https://nodejs.org/en/docs/inspector
Debugger attached.
Found existing install in C:\Users\Peter\source\vsc-print\.vscode-test\vscode-win32-x64-archive-1.68.1. Skipping download
[16792:0704/000228.095:ERROR:node_bindings.cc(286)] Most NODE_OPTIONs are not supported in packaged apps. See documentation for more details.
[16792:0704/000228.095:ERROR:node_bindings.cc(286)] Most NODE_OPTIONs are not supported in packaged apps. See documentation for more details.
[main 2022-07-03T14:02:28.455Z] update#ctor - updates are disabled by the environment
[main 2022-07-03T14:02:29.679Z] Starting extension host with pid 32 (fork() took 15 ms).
Loading development extension at c:\Users\Peter\source\vsc-print
Decryption failed
Print Extension Test Suite
✔ Check platform browser launch command on win32 (200ms)
✔ Check platform alternate browser launch command on win32 (112ms)
✔ Print active editor (304ms)
Could not find the language 'jsonc', did you forget to load/include a language module?
✔ Print folder (812ms)
4 passing (2s)
[main 2022-07-03T14:02:32.887Z] Extension host with pid 32 exited with code: 0, signal: null.
Exit code: 0
Done
Waiting for the debugger to disconnect...
When the Action runs it, this is the output.
Downloaded VS Code into D:\a\vsc-print\vsc-print\.vscode-test\vscode-win32-x64-archive-1.68.1
[main 2022-07-03T13:06:32.496Z] update#ctor - updates are disabled by the environment
workbench#open()
[main 2022-07-03T13:06:37.868Z] Calling fork to start extension host...
[main 2022-07-03T13:06:37.879Z] Starting extension host with pid 776 (fork() took 11 ms).
IExtensionHostStarter.start() took 42 ms.
Loading development extension at d:\a\vsc-print\vsc-print
Print Extension Test Suite
1) Check platform browser launch command on win32
Error: 4 tests failed.
2) Check platform alternate browser launch command on win32
3) Print active editor
at d:\a\vsc-print\vsc-print\out\test\suite\index.js:25:27
4) Print folder
at done (d:\a\vsc-print\vsc-print\node_modules\mocha\lib\mocha.js:1009:7)
0 passing (518ms)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
4 failing
1) Print Extension Test Suite
Check platform browser launch command on win32:
Error: command 'extension.test.browserLaunchCommand' not found
at v._tryExecuteCommand (vscode-file://vscode-app/d:/a/vsc-print/vsc-print/.vscode-test/vscode-win32-x64-archive-1.68.1/resources/app/out/vs/workbench/workbench.desktop.main.js:1706:3532)
at v.executeCommand (vscode-file://vscode-app/d:/a/vsc-print/vsc-print/.vscode-test/vscode-win32-x64-archive-1.68.1/resources/app/out/vs/workbench/workbench.desktop.main.js:1706:3414)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
2) Print Extension Test Suite
Check platform alternate browser launch command on win32:
Error: command 'extension.test.browserLaunchCommand' not found
at v._tryExecuteCommand (vscode-file://vscode-app/d:/a/vsc-print/vsc-print/.vscode-test/vscode-win32-x64-archive-1.68.1/resources/app/out/vs/workbench/workbench.desktop.main.js:1706:3532)
at v.executeCommand (vscode-file://vscode-app/d:/a/vsc-print/vsc-print/.vscode-test/vscode-win32-x64-archive-1.68.1/resources/app/out/vs/workbench/workbench.desktop.main.js:1706:3414)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
3) Print Extension Test Suite
Print active editor:
Error: command 'extension.test.flags' not found
at v._tryExecuteCommand (vscode-file://vscode-app/d:/a/vsc-print/vsc-print/.vscode-test/vscode-win32-x64-archive-1.68.1/resources/app/out/vs/workbench/workbench.desktop.main.js:1706:3532)
at v.executeCommand (vscode-file://vscode-app/d:/a/vsc-print/vsc-print/.vscode-test/vscode-win32-x64-archive-1.68.1/resources/app/out/vs/workbench/workbench.desktop.main.js:1706:3414)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
4) Print Extension Test Suite
Print folder:
Error: command 'extension.test.flags' not found
at v._tryExecuteCommand (vscode-file://vscode-app/d:/a/vsc-print/vsc-print/.vscode-test/vscode-win32-x64-archive-1.68.1/resources/app/out/vs/workbench/workbench.desktop.main.js:1706:3532)
at v.executeCommand (vscode-file://vscode-app/d:/a/vsc-print/vsc-print/.vscode-test/vscode-win32-x64-archive-1.68.1/resources/app/out/vs/workbench/workbench.desktop.main.js:1706:3414)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
[main 2022-07-03T13:06:41.294Z] Waiting for extension host with pid 776 to exit.
[main 2022-07-03T13:06:41.330Z] Extension host with pid 776 exited with code: 1, signal: null.
Exit code: 1
Failed
Failed to run tests
Error: Process completed with exit code 1.
The unrecognised commands are registered near the start of the extension's activation event.
export function activate(context: vscode.ExtensionContext) {
let ecmPrint = vscode.workspace.getConfiguration("print", null).editorContextMenuItemPosition,
etmButton = vscode.workspace.getConfiguration("print", null).editorTitleMenuButton,
disposable: vscode.Disposable;
vscode.commands.executeCommand("setContext", "ecmPrint", ecmPrint);
vscode.commands.executeCommand("setContext", "etmButton", etmButton);
context.subscriptions.push(vscode.workspace.onDidChangeConfiguration(checkConfigurationChange));
context.subscriptions.push(vscode.commands.registerCommand("extension.print", printCommand));
context.subscriptions.push(vscode.commands.registerCommand("extension.printFolder", printFolderCommand));
context.subscriptions.push(vscode.commands.registerCommand("extension.test.flags", () => testFlags));
context.subscriptions.push(vscode.commands.registerCommand("extension.test.browserLaunchCommand", PrintSession.getLaunchBrowserCommand));
This suggests that the activation method hasn't been called. Is this something I must do explicitly?
I just noticed this up the top of extension.test.ts
// You can import and use all API from the 'vscode' module
// as well as import your extension to test it
import * as vscode from 'vscode';
// import * as myExtension from '../../extension';
That's not how my tests are written. They don't import the code and call it directly, they assume the extension is installed and active and they use registered commands. Some of these commands were added for no other reason than to allow fine grained unit tests.
The problem I describe in the question is due to the fact that the extension is not installed.
Discovering I can import from the extension doesn't solve all the problems. Some of my tests are strictly speaking integration tests. They need the extension to be installed and active.
To meet that requirement, gulp package rather than gulp build will also produce the VSIX. The only real trick is obtaining the VSIX name to install it in the test environment.
const vsixName = fs.readdirSync(extensionDevelopmentPath)
.filter(p => path.extname(p) === ".vsix")
.sort((a, b) => a < b ? 1 : a > b ? -1 : 0)[0];
const launchArgs = [
path.resolve(__dirname, '../../src/test/test-docs'),
"--install-extension",
vsixName
];
A hybrid approach is possible; some of the registered commands exist only for use by unit tests. These could be junked in favour of direct calls.

How to change CLI arguments of Jest Runner using VSCode

I'm switching from MacOS to Windows WSL2 Ubuntu subsystem.
I want to run a basic Jest test from VSCode, with the JestRunner plugin :
When I click on the "Run" button, it opens a terminal on VSCode (WSL not PowerShell), but it automatically launches this command
vincent#LAPTOP-xxxxx:~/Development/Labomaton/packages/api/node_modules$ node "//wsl$/Ubuntu-20.04/home/vincent/Development/Labomaton/packages/api/node_modules/jest/bin/jest.js"
"//wsl$/Ubuntu-20.04/home/vincent/Development/Labomaton/packages/api/src/user/infrastructure/rest/pipes/create-user-validation.spec.ts"
-t "Register user into Labomaton missing firstname"
internal/modules/cjs/loader.js:638
throw err;
^
Error: Cannot find module '/wsl$/Ubuntu-20.04/home/vincent/Development/Labomaton/packages/api/node_modules/jest/bin/jest.js'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
at Function.Module._load (internal/modules/cjs/loader.js:562:25)
at Function.Module.runMain (internal/modules/cjs/loader.js:831:12)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3)
So I try to run the same command with the correct path to this node module:
vincent#LAPTOP-xxxxx:~/Development/Labomaton/packages/api/node_modules$ node "/home/vincent/Development/Labomaton/packages/api/node_modules/jest/bin/jest.js"
"/home/vincent/Development/Labomaton/packages/api/src/user/infrastructure/rest/pipes/create-user-validation.spec.ts"
-t "Register user into Labomaton missing firstname"
PASS ../src/user/infrastructure/rest/pipes/create-user-validation.spec.ts
Register user into Labomaton
✓ missing firstname (5 ms)
Test Suites: 1 passed, 1 total
Tests: 1 passed, 1 total
Snapshots: 0 total
Time: 2.313 s
My question is: how to change the path as an argument to this VSCode JestRunner feature?

Problems with running webdriver-manager start --standalone on Azure Devops

I am configuring to run a Protractor test and below are the steps added in Azure devops
When I run this pipeline, it gets struck at webdriver-manager start --standalone. Not coming out of it so that it runs the next command to start test.
Error Log
2021-03-12T09:02:39.2180071Z ##[section]Starting: Run Test Cases
2021-03-12T09:02:39.3078252Z ==============================================================================
2021-03-12T09:02:39.3082840Z Task : Command line
2021-03-12T09:02:39.3085464Z Description : Run a command line script using Bash on Linux and macOS and cmd.exe on Windows
2021-03-12T09:02:39.3086081Z Version : 2.182.0
2021-03-12T09:02:39.3086701Z Author : Microsoft Corporation
2021-03-12T09:02:39.3087524Z Help : https://learn.microsoft.com/azure/devops/pipelines/tasks/utility/command-line
2021-03-12T09:02:39.3088140Z ==============================================================================
2021-03-12T09:02:40.7279581Z Generating script.
2021-03-12T09:02:40.7467500Z Script contents:
2021-03-12T09:02:40.7486434Z node node_modules/protractor/bin/protractor protractor.conf.js
2021-03-12T09:02:40.7928490Z ========================== Starting Command Output ===========================
2021-03-12T09:02:40.8274945Z ##[command]"C:\windows\system32\cmd.exe" /D /E:ON /V:OFF /S /C "CALL "D:\a\_temp\91ab13f0-924e-4e63-a124-869764af15df.cmd""
2021-03-12T09:02:42.4610822Z [09:02:42] I/launcher - Running 1 instances of WebDriver
2021-03-12T09:02:42.4614093Z [09:02:42] I/hosted - Using the selenium server at http://localhost:4444/wd/hub
2021-03-12T09:02:43.5634194Z [09:02:43] E/launcher - Error code: 135
2021-03-12T09:02:43.5635264Z [09:02:43] E/launcher - Error message: ECONNREFUSED connect ECONNREFUSED 127.0.0.1:4444
2021-03-12T09:02:43.5636368Z [09:02:43] E/launcher - Error: ECONNREFUSED connect ECONNREFUSED 127.0.0.1:4444
2021-03-12T09:02:43.5638525Z at ClientRequest.<anonymous> (D:\a\1\s\node_modules\selenium-webdriver\http\index.js:238:15)
2021-03-12T09:02:43.5640056Z at ClientRequest.emit (events.js:315:20)
2021-03-12T09:02:43.5642323Z at Socket.socketErrorListener (_http_client.js:469:9)
2021-03-12T09:02:43.5643094Z at Socket.emit (events.js:315:20)
2021-03-12T09:02:43.5643710Z at emitErrorNT (internal/streams/destroy.js:106:8)
2021-03-12T09:02:43.5644453Z at emitErrorCloseNT (internal/streams/destroy.js:74:3)
2021-03-12T09:02:43.5645162Z at processTicksAndRejections (internal/process/task_queues.js:80:21)
2021-03-12T09:02:43.5645806Z From: Task: WebDriver.createSession()
2021-03-12T09:02:43.5646642Z at Function.createSession (D:\a\1\s\node_modules\selenium-webdriver\lib\webdriver.js:769:24)
2021-03-12T09:02:43.5648679Z at Function.createSession (D:\a\1\s\node_modules\selenium-webdriver\chrome.js:761:15)
2021-03-12T09:02:43.5649636Z at createDriver (D:\a\1\s\node_modules\selenium-webdriver\index.js:170:33)
2021-03-12T09:02:43.5650518Z at Builder.build (D:\a\1\s\node_modules\selenium-webdriver\index.js:626:16)
2021-03-12T09:02:43.5651614Z at Hosted.getNewDriver (D:\a\1\s\node_modules\protractor\built\driverProviders\driverProvider.js:53:33)
2021-03-12T09:02:43.5652586Z at Runner.createBrowser (D:\a\1\s\node_modules\protractor\built\runner.js:195:43)
2021-03-12T09:02:43.5653422Z at D:\a\1\s\node_modules\protractor\built\runner.js:339:29
2021-03-12T09:02:43.5654331Z at _fulfilled (D:\a\1\s\node_modules\protractor\node_modules\q\q.js:834:54)
2021-03-12T09:02:43.5655184Z at D:\a\1\s\node_modules\protractor\node_modules\q\q.js:863:30
2021-03-12T09:02:43.5656122Z at Promise.promise.promiseDispatch (D:\a\1\s\node_modules\protractor\node_modules\q\q.js:796:13)
2021-03-12T09:02:43.5658296Z [09:02:43] E/launcher - Process exited with error code 135
2021-03-12T09:02:43.6876129Z ##[error]Cmd.exe exited with code '135'.
2021-03-12T09:02:43.7575403Z ##[section]Finishing: Run Test Cases
Not coming out of it so that it runs the next command to start test.
The net command is the task Run Test Cases, right? If yes, we could click the task and expand the tab Control Options and ensure the field Run this task is set to Even if a previous task has failed, unless the build was canceled.
Then if the task Webdriver Start fails, the pipeline will continue to run the next task Run Test Cases.
Update1
Not coming out of it so that it runs the next command to start test.
The initial problem has been solved.
Since you have not started or webdriver not get started correctly, we could see the error issue: ECONNREFUSED connect ECONNREFUSED 127.0.0.1:4444. If the previous task successfully runs Webdriver, we will not see the error message.
We need ensure the Webdriver start and then run the Protractor test.
I figured out the problem. We dont need an explict step to start Webdriver and also i had to comment a line in config.js

Fail to initialize IBM Blockchain Platform on VS Code

Failed to activate extension: Failed to execute command "npm" with arguments "rebuild, grpc, --target=7.1.11, --runtime=electron, --update-binary, --fallback-to-build, --target_arch=x64, --dist-url=https://atom.io/download/electron" return code 1
Could not rebuild native dependencies Failed to execute command "npm" with arguments "rebuild, grpc, --target=7.1.11, --runtime=electron, --update-binary, --fallback-to-build, --target_arch=x64, --dist-url=https://atom.io/download/electron" return code 1. Please ensure that you have node and npm installed
PS C:\Users\k> code --version
1.44.2
PS C:\Users\k> node --version
v10.20.1
PS C:\Users\k> npm --version
6.14.4
I've installed all the dependencies and for some reason VS Code is failing to initialize.

Concourse CI Windows Worker

I'm trying to setup a Concourse CI environment with a Windows 7 worker.
I have one machine under Ubuntu Server (16.04) hosting my TSA server and one worker (for the support of git resources), and a second one under Windows 7 hosting a worker.
Everything seems to work fine as:
I can login into the web ui
the fly -t my_concourseci workers command returns :
name containers platform tags team state version
ubuntu 1 linux none none running 1.1
windows7 0 windows none none running 1.1
the fly -t my_concourseci execute -c test.yml command returns:
executing build 146
initializing
running echo Hello World!
Hello World!
with the following content in test.yml file:
platform: windows
run:
path: echo
args: [ "Hello World!" ]
Nevertheless when I add an input to my task:
platform: windows
> inputs:
> - name: concourse
run:
path: echo
args: [ "Hello World!" ]
I get the following error:
executing build 148
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 5698k 0 5698k 0 0 1948k 0 --:--:-- 0:00:02 --:--:-- 1949k
initializing
failed to stream in to volume
errored
If I look at the windows worker log I got this error that comes up:
{"timestamp":"1500642862.643555164",
"source":"baggageclaim",
"message":"baggageclaim.api.volume-server.stream-in.bad-stream-payload",
"log_level":1,
"data":{"error":"tar extract failed (exit status 2). output: \"\\ngzip: stdin: not in gzip format\\n/usr/bin/tar: Child returned status 1\\n/usr/bin/tar: Error is not recoverable: exiting now\\n\"",
"session":"2.1.8730",
"volume":"15bf1fc6-0727-4962-6c84-18446e54ab96"}
}
Any ideas about what can cause a not in gzip format error ? Knowing that if I run the exact same task on a linux platform every works fine.
platform: linux
image_resource:
type: docker-image
source: {repository: busybox}
inputs:
- name: concourse
run:
path: echo
args: [ "Hello World!" ]
----- STDOUT
executing build 149
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 5699k 0 5699k 0 0 1917k 0 --:--:-- 0:00:02 --:--:-- 1918k
initializing
Pulling busybox#sha256:2605a2c4875ce5eb27a9f7403263190cd1af31e48a2044d400320548356251c4...
sha256:2605a2c4875ce5eb27a9f7403263190cd1af31e48a2044d400320548356251c4: Pulling from library/busybox
9e87eff13613: Pulling fs layer
9e87eff13613: Verifying Checksum
9e87eff13613: Download complete
9e87eff13613: Pull complete
Digest: sha256:2605a2c4875ce5eb27a9f7403263190cd1af31e48a2044d400320548356251c4
Status: Downloaded newer image for busybox#sha256:2605a2c4875ce5eb27a9f7403263190cd1af31e48a2044d400320548356251c4
Successfully pulled busybox#sha256:2605a2c4875ce5eb27a9f7403263190cd1af31e48a2044d400320548356251c4.
running echo Hello World!
succeeded
Thanks.
Launch powershell as Administrator, and run the concourse_worker.exe from there. That worked for me.
I am running a Windows Server 2016 Base on AWS based on this AMI ami-e1876a98
Thanks for your answers, it helps me solve my problem.
I were starting my concourse worker within a MSYS 1.0 environment. The thing is that MSYS contains tar and gunzip binaries within the $PATH. When I started concourse worker inside a Power Shell or cmd.exe without any MSYS unix-like binaries in the $PATH it worked like a charm !
Note: Be sure to have no MSYS binaries in the $PATH Windows environment variable for this to work, especially check that Git-Bash environment tools are not added to your windows $PATH environment variable.
Thanks again.