Skip to content

Commit 755c6c4

Browse files
committed
Fix nodejs issue
1 parent 53348e3 commit 755c6c4

File tree

4 files changed

+15
-0
lines changed

4 files changed

+15
-0
lines changed

.github/workflows/main.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,8 @@ jobs:
133133
- name: Manually install labextension for lab2
134134
if: ${{ matrix.jlab_version }} == 2.3.2
135135
run: jupyter labextension install --debug .
136+
env:
137+
NODE_OPTIONS: --openssl-legacy-provider
136138

137139
- name: Test installation files
138140
run: |

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@
6868
},
6969
"jupyterlab": {
7070
"extension": "lib/plugin",
71+
"webpackConfig": "webpack.lab.config.js",
7172
"outputDir": "ipycanvas/labextension",
7273
"sharedPackages": {
7374
"@jupyter-widgets/base": {

webpack.config.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
const path = require('path');
22
const version = require('./package.json').version;
3+
const crypto = require('crypto');
4+
5+
// Workaround for loaders using "md4" by default, which is not supported in FIPS-compliant OpenSSL
6+
const cryptoOrigCreateHash = crypto.createHash;
7+
crypto.createHash = (algorithm) =>
8+
cryptoOrigCreateHash(algorithm == 'md4' ? 'sha256' : algorithm);
39

410
// Custom webpack rules
511
const rules = [

webpack.lab.config.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
const crypto = require('crypto');
2+
3+
// Workaround for loaders using "md4" by default, which is not supported in FIPS-compliant OpenSSL
4+
const cryptoOrigCreateHash = crypto.createHash;
5+
crypto.createHash = (algorithm) =>
6+
cryptoOrigCreateHash(algorithm == 'md4' ? 'sha256' : algorithm);

0 commit comments

Comments
 (0)