Cannot build jupyter extension: Error: Can't resolve './plugins/notebooks'

Hi folks,

I appreciate the great community here. I am installing some extensions for jupyterlab. However, the build process failed. Below is the log file. Any thoughts are well appreciated!

╰─$ cat /glade/scratch/che43/jupyterlab-debug-5bvd32ck.log 1 ↵
[LabBuildApp] Building in /glade/work/che43/tools/miniconda3/envs/miami/share/jupyter/lab
[LabBuildApp] Node v16.14.2

[LabBuildApp] Yarn configuration loaded.
[LabBuildApp] Building jupyterlab assets (production, minimized)
[LabBuildApp] > node /glade/u/home/che43/miniconda3/envs/miami/lib/python3.8/site-packages/jupyterlab/staging/yarn.js install --non-interactive
[LabBuildApp] yarn install v1.21.1
[1/5] Validating package.json…
[2/5] Resolving packages…
success Already up-to-date.
Done in 0.56s.

[LabBuildApp] > node /glade/u/home/che43/miniconda3/envs/miami/lib/python3.8/site-packages/jupyterlab/staging/yarn.js yarn-deduplicate -s fewer --fail
[LabBuildApp] yarn run v1.21.1
$ /glade/work/che43/tools/miniconda3/envs/miami/share/jupyter/lab/staging/node_modules/.bin/yarn-deduplicate -s fewer --fail
Done in 0.66s.

[LabBuildApp] > node /glade/u/home/che43/miniconda3/envs/miami/lib/python3.8/site-packages/jupyterlab/staging/yarn.js run build:prod:minimize
[LabBuildApp] yarn run v1.21.1
$ webpack --config webpack.prod.minimize.config.js
[webpack-cli] ModuleNotFoundError: Module not found: Error: Can’t resolve ‘./plugins/notebooks’ in ‘/glade/work/che43/tools/miniconda3/envs/miami/share/jupyter/lab/staging/node_modules/@tabnine/jupyterlab/out/src’
at /glade/work/che43/tools/miniconda3/envs/miami/share/jupyter/lab/staging/node_modules/webpack/lib/Compilation.js:1768:28
at /glade/work/che43/tools/miniconda3/envs/miami/share/jupyter/lab/staging/node_modules/webpack/lib/NormalModuleFactory.js:742:13
at eval (eval at create (/glade/work/che43/tools/miniconda3/envs/miami/share/jupyter/lab/staging/node_modules/tapable/lib/HookCodeFactory.js:33:10), :10:1)
at /glade/work/che43/tools/miniconda3/envs/miami/share/jupyter/lab/staging/node_modules/webpack/lib/NormalModuleFactory.js:276:22
at eval (eval at create (/glade/work/che43/tools/miniconda3/envs/miami/share/jupyter/lab/staging/node_modules/tapable/lib/HookCodeFactory.js:33:10), :9:1)
at /glade/work/che43/tools/miniconda3/envs/miami/share/jupyter/lab/staging/node_modules/webpack/lib/NormalModuleFactory.js:405:22
at /glade/work/che43/tools/miniconda3/envs/miami/share/jupyter/lab/staging/node_modules/webpack/lib/NormalModuleFactory.js:119:11
at /glade/work/che43/tools/miniconda3/envs/miami/share/jupyter/lab/staging/node_modules/webpack/lib/NormalModuleFactory.js:650:24
at /glade/work/che43/tools/miniconda3/envs/miami/share/jupyter/lab/staging/node_modules/webpack/lib/NormalModuleFactory.js:813:8
at /glade/work/che43/tools/miniconda3/envs/miami/share/jupyter/lab/staging/node_modules/webpack/lib/NormalModuleFactory.js:933:5
resolve ‘./plugins/notebooks’ in ‘/glade/work/che43/tools/miniconda3/envs/miami/share/jupyter/lab/staging/node_modules/@tabnine/jupyterlab/out/src’
using description file: /glade/work/che43/tools/miniconda3/envs/miami/share/jupyter/lab/staging/node_modules/@tabnine/jupyterlab/package.json (relative path: ./out/src)
Field ‘browser’ doesn’t contain a valid alias configuration
using description file: /glade/work/che43/tools/miniconda3/envs/miami/share/jupyter/lab/staging/node_modules/@tabnine/jupyterlab/package.json (relative path: ./out/src/plugins/notebooks)
no extension
Field ‘browser’ doesn’t contain a valid alias configuration
/glade/work/che43/tools/miniconda3/envs/miami/share/jupyter/lab/staging/node_modules/@tabnine/jupyterlab/out/src/plugins/notebooks doesn’t exist
.js
Field ‘browser’ doesn’t contain a valid alias configuration
/glade/work/che43/tools/miniconda3/envs/miami/share/jupyter/lab/staging/node_modules/@tabnine/jupyterlab/out/src/plugins/notebooks.js doesn’t exist
.json
Field ‘browser’ doesn’t contain a valid alias configuration
/glade/work/che43/tools/miniconda3/envs/miami/share/jupyter/lab/staging/node_modules/@tabnine/jupyterlab/out/src/plugins/notebooks.json doesn’t exist
.wasm
Field ‘browser’ doesn’t contain a valid alias configuration
/glade/work/che43/tools/miniconda3/envs/miami/share/jupyter/lab/staging/node_modules/@tabnine/jupyterlab/out/src/plugins/notebooks.wasm doesn’t exist
as directory
/glade/work/che43/tools/miniconda3/envs/miami/share/jupyter/lab/staging/node_modules/@tabnine/jupyterlab/out/src/plugins/notebooks doesn’t exist
error Command failed with exit code 2.
info Visit yarn run | Yarn for documentation about this command.

[LabBuildApp] JupyterLab failed to build
[LabBuildApp] Traceback (most recent call last):

[LabBuildApp] File “/glade/u/home/che43/miniconda3/envs/miami/lib/python3.8/site-packages/jupyterlab/debuglog.py”, line 47, in debug_logging
yield

[LabBuildApp] File “/glade/u/home/che43/miniconda3/envs/miami/lib/python3.8/site-packages/jupyterlab/labapp.py”, line 196, in start
raise e

[LabBuildApp] File “/glade/u/home/che43/miniconda3/envs/miami/lib/python3.8/site-packages/jupyterlab/labapp.py”, line 187, in start
build(

[LabBuildApp] File “/glade/u/home/che43/miniconda3/envs/miami/lib/python3.8/site-packages/jupyterlab/commands.py”, line 498, in build
return handler.build(

[LabBuildApp] File “/glade/u/home/che43/miniconda3/envs/miami/lib/python3.8/site-packages/jupyterlab/commands.py”, line 713, in build
raise RuntimeError(msg)

[LabBuildApp] RuntimeError: JupyterLab failed to build

[LabBuildApp] Exiting application: JupyterLab

Unless you really need to, you should try to:

  • be running jupyterlab>=3
    • if you can’t control it, that’s one thing, but it’s really much easier for us to help
  • be using only pre-built extensions
    • these are handled by pip install or conda install, and don’t require nodejs to rebuild
    • basically you can check with jupyter labextension list and it will tell you if a rebuild is required
      • if it isn’t… don’t!

So to try again, i recommend:

  • build an environment.yml of all the stuff you need
  • try to conda env update it
  • see if that “just works”