[Debian-pan-maintainers] Bug#1102558: jupyterlab: runtime fails with ReferenceError: require is not defined

PICCA Frederic-Emmanuel frederic-emmanuel.picca at synchrotron-soleil.fr
Fri May 30 14:21:41 BST 2025


If I remove the external commonjs crypto, the error comes from here


ERROR in node:crypto
Module build failed: UnhandledSchemeError: Reading from "node:crypto" is not handled by plugins (Unhandled scheme).
Webpack supports "data:" and "file:" URIs by default.
You may need an additional plugin to handle "node:" URIs.
    at /usr/share/nodejs/webpack/lib/NormalModule.js:984:10
    at Hook.eval [as callAsync] (eval at create (/usr/share/nodejs/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:6:1)
    at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (/usr/share/nodejs/tapable/lib/Hook.js:18:14)
    at Object.processResource (/usr/share/nodejs/webpack/lib/NormalModule.js:980:8)
    at processResource (/usr/share/nodejs/loader-runner/lib/LoaderRunner.js:220:11)
    at iteratePitchingLoaders (/usr/share/nodejs/loader-runner/lib/LoaderRunner.js:171:10)
    at runLoaders (/usr/share/nodejs/loader-runner/lib/LoaderRunner.js:398:2)
    at NormalModule._doBuild (/usr/share/nodejs/webpack/lib/NormalModule.js:965:3)
    at NormalModule.build (/usr/share/nodejs/webpack/lib/NormalModule.js:1155:15)
    at /usr/share/nodejs/webpack/lib/Compilation.js:1422:12
 @ ../../../../usr/share/nodejs/@rjsf/core/lib/index.js 1:0-40 44141:4-29 44144:4-29
 @ ../packages/ui-components/lib/components/form.js 7:0-30 281:32-36
 @ ../packages/ui-components/lib/components/index.js 5:0-23 5:0-23
 @ ../packages/ui-components/lib/index.js 7:0-29 7:0-29
 @ consume shared module (default) @jupyterlab/ui-components@~4.0.11 (singleton) (fallback: ../packages/ui-components/lib/index.js)
 @ ../packages/apputils-extension/lib/index.js 15:0-63 139:8-34
 @ consume shared module (default) @jupyterlab/apputils-extension@~4.0.11 (strict) (fallback: ../packages/apputils-extension/lib/index.js)
 @ ./static/index.out.js 187:16-57
 @ ./static/bootstrap.js

webpack 5.97.1 compiled with 1 error and 274 warnings in 15626 ms

asset index.css 17.4 KiB [emitted] (name: index)
asset index.js 0 bytes [emitted] [minimized] (name: index)
Entrypoint index 17.4 KiB = index.css 17.4 KiB index.js 0 bytes
orphan modules 20.8 KiB (javascript) 937 bytes (runtime) [orphan] 8 modules
cacheable modules 50 bytes (javascript) 17.4 KiB (css/mini-extract)
  ../packages/theme-dark-extension/style/theme.css 50 bytes [built] [code generated]
  css ../../../../usr/share/nodejs/css-loader/dist/cjs.js!../packages/theme-dark-extension/style/variables.css 16.7 KiB [built] [code generated]
  css ../../../../usr/share/nodejs/css-loader/dist/cjs.js!../packages/theme-dark-extension/style/theme.css 668 bytes [built] [code generated]
webpack 5.97.1 compiled successfully in 667 ms

asset index.css 16.1 KiB [emitted] (name: index)
asset index.js 0 bytes [emitted] [minimized] (name: index)
Entrypoint index 16.1 KiB = index.css 16.1 KiB index.js 0 bytes
orphan modules 19.5 KiB (javascript) 937 bytes (runtime) [orphan] 8 modules
cacheable modules 50 bytes (javascript) 16.1 KiB (css/mini-extract)
  ../packages/theme-light-extension/style/theme.css 50 bytes [built] [code generated]
  css ../../../../usr/share/nodejs/css-loader/dist/cjs.js!../packages/theme-light-extension/style/variables.css 15.6 KiB [built] [code generated]
  css ../../../../usr/share/nodejs/css-loader/dist/cjs.js!../packages/theme-light-extension/style/theme.css 472 bytes [built] [code generated]
webpack 5.97.1 compiled successfully in 668 ms


And indeed the firt line of 

/usr/share/nodejs/@rjsf/core/lib/index.js

containes this:

import { webcrypto } from 'node:crypto';

This file is part of the package

dpkg -S /usr/share/nodejs/@rjsf/core/lib/index.js
node-rjsf: /usr/share/nodejs/@rjsf/core/lib/index.js

the last upload has this changelog

Format: 1.8
Date: Fri, 28 Mar 2025 08:50:19 +0000
Source: node-rjsf
Architecture: source
Version: 5.12.1+~5.0.1-3
Distribution: unstable
Urgency: medium
Maintainer: Debian Javascript Maintainers <pkg-javascript-devel at lists.alioth.debian.org>
Changed-By: Julian Gilbey <jdg at debian.org>
Changes:
 node-rjsf (5.12.1+~5.0.1-3) unstable; urgency=medium
 .
   * Team upload
   * Rebuild against current NodeJS/Webpack/... to ensure 'crypto' is
     imported from node rather than an external package

is it the real issue ?



More information about the Debian-pan-maintainers mailing list