Hello!
I am facing problems which I cannot solve when trying to write my first extension to jupyterlab.
In short, I try to follow https: //ipywidgets. readthedocs. io/en/latest/examples/Widget%20Custom.html. My impression is that https: //github. com/jupyter-widgets/widget-ts-cookiecutter mentioned in the custom widget tutorial is not compatible with jupyterlab 4. This is why I start from another - working - template (see below).
The reason for the problems seems to be missing *.js.map sourcemaps for several sources.
What I did:
First I copied an extension template using
copier copy --trust https: //github. com/jupyterlab/extension-template .
I selected “server” as extension type.
Next I started adding parts from https: //ipywidgets. readthedocs. io/en/latest/examples/Widget%20Custom.html. I added this into the previously created src/index.ts:
import {
DOMWidgetModel,
DOMWidgetView,
ISerializers,
WidgetModel
} from ‘[at]jupyter-widgets/base’;export class EmailView extends DOMWidgetView {
render() {
this.el.classList.add(‘custom-widget’);this.value_changed(); this.model.on('change:value', this.value_changed, this);
}
value_changed() {
this.el.textContent = this.model.get(‘value’);
}
}
With these changes I get the errors below. What can I do to fix the errors like “Failed to parse source map from ‘/home/user/projects/venv2/myextension/node_modules/[at]jupyter-widgets/base/lib/backbone-patch.js.map’ file: Error: ENOENT: no such file or directory, open ‘/home/user/projects/venv2/myextension/node_modules/[at]jupyter-widgets/base/lib/backbone-patch.js.map’”?
Thank you very much!
(I apologize that I had to insert spaces in links and replace “@” with “[at]”, because github wouldn’t let me post many links and mention many users.
Here is the output from “jlpm run build”: )
Building extension in .
Compilation starting…
Compilation finished
asset vendors-node_modules_jupyter-widgets_base_lib_index_js.958ac50074180d7e2924.js 811 KiB [emitted] [immutable] (id hint: vendors) 1 related asset
asset remoteEntry.c2141a87c112b0bb3a1e.js 28.7 KiB [emitted] [immutable] (name: myextension) 1 related asset
asset style_index_js.7767634a848ea18db863.js 18.9 KiB [emitted] [immutable] 1 related asset
asset lib_index_js-webpack_sharing_consume_default_lumino_coreutils-webpack_sharing_consume_default-425c44.28266eb9273c47d9295e.js 5.17 KiB [emitted] [immutable] 1 related asset
runtime modules 19 KiB 14 modules
modules by path ./node_modules/ 584 KiB 273 modules
consume-shared-module modules 210 bytes
modules by path consume shared module (default) [at]lumino/ 126 bytes 3 modules
modules by path consume shared module (default) [at]jupyterlab/*.10 (singleton) 84 bytes 2 modules
modules by path ./style/ 1.94 KiB
./style/index.js 21 bytes [built] [code generated]
./style/base.css 1.11 KiB [built] [code generated]
./node_modules/css-loader/dist/cjs.js!./style/base.css 829 bytes [built] [code generated]
modules by path ./lib/*.js 2.78 KiB
./lib/index.js 1.7 KiB [built] [code generated]
./lib/handler.js 1.08 KiB [built] [code generated]
container entry 42 bytes [built] [code generated]
provide shared module (default) myextension[at]0.1.0 = ./lib/index.js 42 bytes [built] [code generated]
WARNING in ./node_modules/[at]jupyter-widgets/base/lib/backbone-patch.js
Module Warning (from ./node_modules/[at]jupyterlab/builder/node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from ‘/home/user/projects/venv2/myextension/node_modules/[at]jupyter-widgets/base/lib/backbone-patch.js.map’ file: Error: ENOENT: no such file or directory, open ‘/home/user/projects/venv2/myextension/node_modules/[at]jupyter-widgets/base/lib/backbone-patch.js.map’
[at] ./node_modules/[at]jupyter-widgets/base/lib/widget.js 4:0-50 329:29-51
[at] ./node_modules/[at]jupyter-widgets/base/lib/index.js 3:0-25 3:0-25
[at] ./lib/index.js 2:0-54 48:31-44
[at] container entry ./extension[0] ./index[0]
WARNING in ./node_modules/[at]jupyter-widgets/base/lib/errorwidget.js
Module Warning (from ./node_modules/[at]jupyterlab/builder/node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from ‘/home/user/projects/venv2/myextension/node_modules/[at]jupyter-widgets/base/lib/errorwidget.js.map’ file: Error: ENOENT: no such file or directory, open ‘/home/user/projects/venv2/myextension/node_modules/[at]jupyter-widgets/base/lib/errorwidget.js.map’
[at] ./node_modules/[at]jupyter-widgets/base/lib/index.js 12:0-30 12:0-30
[at] ./lib/index.js 2:0-54 48:31-44
[at] container entry ./extension[0] ./index[0]
WARNING in ./node_modules/[at]jupyter-widgets/base/lib/index.js
Module Warning (from ./node_modules/[at]jupyterlab/builder/node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from ‘/home/user/projects/venv2/myextension/node_modules/[at]jupyter-widgets/base/lib/index.js.map’ file: Error: ENOENT: no such file or directory, open ‘/home/user/projects/venv2/myextension/node_modules/[at]jupyter-widgets/base/lib/index.js.map’
[at] ./lib/index.js 2:0-54 48:31-44
[at] container entry ./extension[0] ./index[0]
WARNING in ./node_modules/[at]jupyter-widgets/base/lib/manager.js
Module Warning (from ./node_modules/[at]jupyterlab/builder/node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from ‘/home/user/projects/venv2/myextension/node_modules/[at]jupyter-widgets/base/lib/manager.js.map’ file: Error: ENOENT: no such file or directory, open ‘/home/user/projects/venv2/myextension/node_modules/[at]jupyter-widgets/base/lib/manager.js.map’
[at] ./node_modules/[at]jupyter-widgets/base/lib/index.js 4:0-26 4:0-26
[at] ./lib/index.js 2:0-54 48:31-44
[at] container entry ./extension[0] ./index[0]
WARNING in ./node_modules/[at]jupyter-widgets/base/lib/nativeview.js
Module Warning (from ./node_modules/[at]jupyterlab/builder/node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from ‘/home/user/projects/venv2/myextension/node_modules/[at]jupyter-widgets/base/lib/nativeview.js.map’ file: Error: ENOENT: no such file or directory, open ‘/home/user/projects/venv2/myextension/node_modules/[at]jupyter-widgets/base/lib/nativeview.js.map’
[at] ./node_modules/[at]jupyter-widgets/base/lib/widget.js 7:0-42 609:32-42
[at] ./node_modules/[at]jupyter-widgets/base/lib/index.js 3:0-25 3:0-25
[at] ./lib/index.js 2:0-54 48:31-44
[at] container entry ./extension[0] ./index[0]
WARNING in ./node_modules/[at]jupyter-widgets/base/lib/registry.js
Module Warning (from ./node_modules/[at]jupyterlab/builder/node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from ‘/home/user/projects/venv2/myextension/node_modules/[at]jupyter-widgets/base/lib/registry.js.map’ file: Error: ENOENT: no such file or directory, open ‘/home/user/projects/venv2/myextension/node_modules/[at]jupyter-widgets/base/lib/registry.js.map’
[at] ./node_modules/[at]jupyter-widgets/base/lib/index.js 11:0-27 11:0-27
[at] ./lib/index.js 2:0-54 48:31-44
[at] container entry ./extension[0] ./index[0]
WARNING in ./node_modules/[at]jupyter-widgets/base/lib/services-shim.js
Module Warning (from ./node_modules/[at]jupyterlab/builder/node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from ‘/home/user/projects/venv2/myextension/node_modules/[at]jupyter-widgets/base/lib/services-shim.js.map’ file: Error: ENOENT: no such file or directory, open ‘/home/user/projects/venv2/myextension/node_modules/[at]jupyter-widgets/base/lib/services-shim.js.map’
[at] ./node_modules/[at]jupyter-widgets/base/lib/index.js 7:0-32 7:0-32
[at] ./lib/index.js 2:0-54 48:31-44
[at] container entry ./extension[0] ./index[0]
WARNING in ./node_modules/[at]jupyter-widgets/base/lib/utils.js
Module Warning (from ./node_modules/[at]jupyterlab/builder/node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from ‘/home/user/projects/venv2/myextension/node_modules/[at]jupyter-widgets/base/lib/utils.js.map’ file: Error: ENOENT: no such file or directory, open ‘/home/user/projects/venv2/myextension/node_modules/[at]jupyter-widgets/base/lib/utils.js.map’
[at] ./node_modules/[at]jupyter-widgets/base/lib/index.js 10:0-24 10:0-24
[at] ./lib/index.js 2:0-54 48:31-44
[at] container entry ./extension[0] ./index[0]
WARNING in ./node_modules/[at]jupyter-widgets/base/lib/version.js
Module Warning (from ./node_modules/[at]jupyterlab/builder/node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from ‘/home/user/projects/venv2/myextension/node_modules/[at]jupyter-widgets/base/lib/version.js.map’ file: Error: ENOENT: no such file or directory, open ‘/home/user/projects/venv2/myextension/node_modules/[at]jupyter-widgets/base/lib/version.js.map’
[at] ./node_modules/[at]jupyter-widgets/base/lib/index.js 9:0-26 9:0-26
[at] ./lib/index.js 2:0-54 48:31-44
[at] container entry ./extension[0] ./index[0]
WARNING in ./node_modules/[at]jupyter-widgets/base/lib/viewlist.js
Module Warning (from ./node_modules/[at]jupyterlab/builder/node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from ‘/home/user/projects/venv2/myextension/node_modules/[at]jupyter-widgets/base/lib/viewlist.js.map’ file: Error: ENOENT: no such file or directory, open ‘/home/user/projects/venv2/myextension/node_modules/[at]jupyter-widgets/base/lib/viewlist.js.map’
[at] ./node_modules/[at]jupyter-widgets/base/lib/index.js 8:0-27 8:0-27
[at] ./lib/index.js 2:0-54 48:31-44
[at] container entry ./extension[0] ./index[0]
WARNING in ./node_modules/[at]jupyter-widgets/base/lib/widget.js
Module Warning (from ./node_modules/[at]jupyterlab/builder/node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from ‘/home/user/projects/venv2/myextension/node_modules/[at]jupyter-widgets/base/lib/widget.js.map’ file: Error: ENOENT: no such file or directory, open ‘/home/user/projects/venv2/myextension/node_modules/[at]jupyter-widgets/base/lib/widget.js.map’
[at] ./node_modules/[at]jupyter-widgets/base/lib/index.js 3:0-25 3:0-25
[at] ./lib/index.js 2:0-54 48:31-44
[at] container entry ./extension[0] ./index[0]
WARNING in ./node_modules/[at]jupyter-widgets/base/lib/widget_layout.js
Module Warning (from ./node_modules/[at]jupyterlab/builder/node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from ‘/home/user/projects/venv2/myextension/node_modules/[at]jupyter-widgets/base/lib/widget_layout.js.map’ file: Error: ENOENT: no such file or directory, open ‘/home/user/projects/venv2/myextension/node_modules/[at]jupyter-widgets/base/lib/widget_layout.js.map’
[at] ./node_modules/[at]jupyter-widgets/base/lib/index.js 5:0-32 5:0-32
[at] ./lib/index.js 2:0-54 48:31-44
[at] container entry ./extension[0] ./index[0]
WARNING in ./node_modules/[at]jupyter-widgets/base/lib/widget_style.js
Module Warning (from ./node_modules/[at]jupyterlab/builder/node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from ‘/home/user/projects/venv2/myextension/node_modules/[at]jupyter-widgets/base/lib/widget_style.js.map’ file: Error: ENOENT: no such file or directory, open ‘/home/user/projects/venv2/myextension/node_modules/[at]jupyter-widgets/base/lib/widget_style.js.map’
[at] ./node_modules/[at]jupyter-widgets/base/lib/index.js 6:0-31 6:0-31
[at] ./lib/index.js 2:0-54 48:31-44
[at] container entry ./extension[0] ./index[0]
13 warnings have detailed information that is not shown.
Use ‘stats.errorDetails: true’ resp. ‘–stats-error-details’ to show it.
webpack 5.89.0 compiled with 13 warnings in 1727 ms