[Pkg-javascript-devel] packaging and debuging of the javascript part of ipywidgets
picca
picca at debian.org
Wed Dec 25 16:11:18 GMT 2024
Hello,
Now I can build the widgetsnbextension using the Debian nodejs way. (not
that hard... :)) (end of the email)
but I end up with strange error when building the jupyterlab_widgets
extension.
webpack 5.97.1 compiled with 4 warnings in 7742 ms
Found debian/nodejs/python/jupyterlab_widgets/build
cd ./python/jupyterlab_widgets && sh -ex
../../debian/nodejs/python/jupyterlab_widgets/build
+ pkgjs-run build:prod
> @jupyter-widgets/jupyterlab-manager at 5.0.13 build:prod
> jlpm build:lib && jlpm build:labextension
Internal Error: root-workspace-0b6124 at workspace:.: This package doesn't
seem to be present in your lockfile; run "yarn install" to update the
lockfile
at bN.resolve
(/usr/share/nodejs/@yarnpkg/cli/bundles/yarn.js:206:13156)
at Yy.resolve
(/usr/share/nodejs/@yarnpkg/cli/bundles/yarn.js:141:1488)
at /usr/share/nodejs/@yarnpkg/cli/bundles/yarn.js:211:7246
at iw (/usr/share/nodejs/@yarnpkg/cli/bundles/yarn.js:140:52509)
at le (/usr/share/nodejs/@yarnpkg/cli/bundles/yarn.js:211:7226)
at /usr/share/nodejs/@yarnpkg/cli/bundles/yarn.js:211:7858
if I call by hand the jlmp build:labextension -> jupyter labextension
build .
I get this error message:
+ jupyter labextension build .
Fail to get yarn configuration. Expecting value: line 1 column 1 (char
0)
Fail to get yarn configuration. Expecting value: line 1 column 1 (char
0)
Building extension in .
node:internal/modules/cjs/loader:1228
throw err;
^
Error: Cannot find module 'license-webpack-plugin'
Require stack:
- /usr/share/nodejs/@jupyterlab/builder/lib/webpack-plugins.js
- /usr/share/nodejs/@jupyterlab/builder/lib/extensionConfig.js
- /usr/share/nodejs/@jupyterlab/builder/lib/build-labextension.js
at Module._resolveFilename
(node:internal/modules/cjs/loader:1225:15)
at Module._load (node:internal/modules/cjs/loader:1051:27)
at Module.require (node:internal/modules/cjs/loader:1311:19)
at require (node:internal/modules/helpers:179:18)
at Object.<anonymous>
(/usr/share/nodejs/@jupyterlab/builder/lib/webpack-plugins.js:36:34)
at Module._compile (node:internal/modules/cjs/loader:1469:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1548:10)
at Module.load (node:internal/modules/cjs/loader:1288:32)
at Module._load (node:internal/modules/cjs/loader:1104:12)
at Module.require (node:internal/modules/cjs/loader:1311:19) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'/usr/share/nodejs/@jupyterlab/builder/lib/webpack-plugins.js',
'/usr/share/nodejs/@jupyterlab/builder/lib/extensionConfig.js',
'/usr/share/nodejs/@jupyterlab/builder/lib/build-labextension.js'
]
}
Node.js v20.18.1
/usr/lib/python3/dist-packages/jupyterlab/debuglog.py:56: UserWarning:
An error occurred.
warnings.warn("An error occurred.")
/usr/lib/python3/dist-packages/jupyterlab/debuglog.py:57: UserWarning:
subprocess.CalledProcessError: Command '['node',
'/home/picca/debian/python-team/packages/ipywidgets/python/jupyterlab_widgets/node_modules/@jupyterlab/builder/lib/build-labextension.js',
'--core-path', '/usr/lib/python3/dist-packages/jupyterlab/staging',
'/home/picca/debian/python-team/packages/ipywidgets/python/jupyterlab_widgets']'
returned non-zero exit status 1.
warnings.warn(msg[-1].strip())
/usr/lib/python3/dist-packages/jupyterlab/debuglog.py:58: UserWarning:
See the log file for details: /tmp/jupyterlab-debug-vw96n9o9.log
warnings.warn(f"See the log file for details: {log_path!s}")
@Yadd It seems to me that the node-license-webpack-plugin dependency is
missing in the jupyterlab package. Right ?
If I add the dependency -> Halleluia !!! it build with only Debian
packages (C'est Noël :))
BUT
the behaviour of the widgets are wrong...., So the final assemblage is
not equivalent to the upstream one....
-- widget nbextension build log
dh_auto_build --buildsystem=nodejs
./lerna.json found
workspaces field found in package.json
/!\ examples/embed-amd/package.json not found
Unable to load examples/embed-amd
Found debian/nodejs/additional_components
Adding component(s): packages/output
Adding component(s): python/widgetsnbextension
Adding component(s): python/jupyterlab_widgets
Found debian/nodejs/packages/output/build
cd ./packages/output && sh -ex
../../debian/nodejs/packages/output/build
+ pkgjs-install-minimal
+ pkgjs-run build
> @jupyter-widgets/output at 6.0.10 build
> pkgjs run build:src
> @jupyter-widgets/output at 6.0.10 build:src
> tsc --build
Found debian/nodejs/python/widgetsnbextension/build
cd ./python/widgetsnbextension && sh -ex
../../debian/nodejs/python/widgetsnbextension/build
+ pkgjs-install-minimal
+ pkgjs-run build
> @jupyter-widgets/notebook-manager at 8.0.13 build
> pkgjs run build:nbextension
> @jupyter-widgets/notebook-manager at 8.0.13 build:nbextension
> webpack
asset extension.js 948 KiB [emitted] [minimized] [big] (name: main) 2
related assets
orphan modules 463 KiB [orphan] 65 modules
runtime modules 1.72 KiB 9 modules
modules by path ../../../../../../../../usr/share/nodejs/ 2.22 MiB
javascript modules 2.22 MiB 253 modules
json modules 5.08 KiB
../../../../../../../../usr/share/nodejs/@jupyter-widgets/controls/package.json
2.57 KiB [built] [code generated]
../../../../../../../../usr/share/nodejs/@jupyter-widgets/html-manage...(truncated)
2.51 KiB [built] [code generated]
modules by path ./ 32.2 KiB
modules by path ./src/ 31.5 KiB
modules by path ./src/*.js 28.5 KiB 5 modules
modules by path ./src/*.css 3.06 KiB 2 modules
./amd-public-path.js 647 bytes [built] [code generated]
./terminal-highlight (ignored) 15 bytes [built] [code generated]
+ 8 modules
WARNING in configuration
The 'mode' option has not been set, webpack will fallback to
'production' for this value.
Set 'mode' option to 'development' or 'production' to enable defaults
for each environment.
You can also set it to 'none' to disable any default behavior. Learn
more: https://webpack.js.org/configuration/mode/
WARNING in asset size limit: The following asset(s) exceed the
recommended size limit (244 KiB).
This can impact web performance.
Assets:
extension.js (948 KiB)
WARNING in entrypoint size limit: The following entrypoint(s) combined
asset size exceeds the recommended limit (244 KiB). This can impact web
performance.
Entrypoints:
main (948 KiB)
extension.js
WARNING in webpack performance recommendations:
You can limit the size of your bundles by using import() or
require.ensure to lazy load some parts of your application.
For more info visit https://webpack.js.org/guides/code-splitting/
More information about the Pkg-javascript-devel
mailing list