"jupyter lab build" fails with Invalid regular expression

Dear all,

I’m running a fresh new jupyterhub 1.4.1 installtion follwoing the offcial docs.

$ jupyterhub --version
1.4.1

$ jupyter --version
jupyter core     : 4.7.1
jupyter-notebook : 6.4.0
qtconsole        : not installed
ipython          : 7.24.1
ipykernel        : 5.5.5
jupyter client   : 6.1.12
jupyter lab      : 3.0.16
nbconvert        : 6.0.7
ipywidgets       : 7.6.3
nbformat         : 5.1.3
traitlets        : 5.0.5

The hub is up and running and now I’d like to add Jupyterlab extension.
the package is installed (among others):

$ pip list|grep -i lab
jupyterlab                        3.0.16
jupyterlab-git                    0.30.1
jupyterlab-pygments               0.1.2
jupyterlab-server                 2.6.0
jupyterlab-widgets                1.0.0

$ jupyter labextension list
JupyterLab v3.0.16

Build recommended, please run `jupyter lab build`:
    No built application

but when I build it always fails with the next error:

[LabBuildApp] Node v12.19.0
[LabBuildApp] Yarn configuration loaded.
[LabBuildApp] Building jupyterlab assets (production, minimized)
[LabBuildApp] > node /apps/prod/easybuild/sl7.x86_64.foss-2021a/software/jupyterhub/1.4.1-foss-2021a-Python-3.9.5/lib/python3.9/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.46s.
[...]
[LabBuildApp] > node /apps/prod/easybuild/sl7.x86_64.foss-2021a/software/jupyterhub/1.4.1-foss-2021a-Python-3.9.5/lib/python3.9/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] SyntaxError: Invalid regular expression: /(\p{Uppercase_Letter}+|\p{Lowercase_Letter}|\d)(\p{Uppercase_Letter}+)/: Invalid property name
    at pathToArgumentName (/apps/prod/easybuild/sl7.x86_64.foss-2021a/software/Python/3.9.5-GCCcore-10.3.0-bare/share/jupyter/lab/staging/node_modules/webpack/lib/cli.js:66:4)
    at addFlag (/apps/prod/easybuild/sl7.x86_64.foss-2021a/software/Python/3.9.5-GCCcore-10.3.0-bare/share/jupyter/lab/staging/node_modules/webpack/lib/cli.js:170:16)
    at traverse (/apps/prod/easybuild/sl7.x86_64.foss-2021a/software/Python/3.9.5-GCCcore-10.3.0-bare/share/jupyter/lab/staging/node_modules/webpack/lib/cli.js:243:21)
    at traverse (/apps/prod/easybuild/sl7.x86_64.foss-2021a/software/Python/3.9.5-GCCcore-10.3.0-bare/share/jupyter/lab/staging/node_modules/webpack/lib/cli.js:299:23)
    at traverse (/apps/prod/easybuild/sl7.x86_64.foss-2021a/software/Python/3.9.5-GCCcore-10.3.0-bare/share/jupyter/lab/staging/node_modules/webpack/lib/cli.js:248:24)
    at Object.getArguments (/apps/prod/easybuild/sl7.x86_64.foss-2021a/software/Python/3.9.5-GCCcore-10.3.0-bare/share/jupyter/lab/staging/node_modules/webpack/lib/cli.js:308:2)
    at WebpackCLI.getBuiltInOptions (/apps/prod/easybuild/sl7.x86_64.foss-2021a/software/Python/3.9.5-GCCcore-10.3.0-bare/share/jupyter/lab/staging/node_modules/webpack-cli/lib/webpack-cli.js:591:47)
    at loadCommandByName (/apps/prod/easybuild/sl7.x86_64.foss-2021a/software/Python/3.9.5-GCCcore-10.3.0-bare/share/jupyter/lab/staging/node_modules/webpack-cli/lib/webpack-cli.js:732:38)
    at Command.<anonymous> (/apps/prod/easybuild/sl7.x86_64.foss-2021a/software/Python/3.9.5-GCCcore-10.3.0-bare/share/jupyter/lab/staging/node_modules/webpack-cli/lib/webpack-cli.js:1260:23)
    at Command.listener [as _actionHandler] (/apps/prod/easybuild/sl7.x86_64.foss-2021a/software/Python/3.9.5-GCCcore-10.3.0-bare/share/jupyter/lab/staging/node_modules/webpack-cli/node_modules/commander/index.js:922:31)
error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

[LabBuildApp] JupyterLab failed to build

I do not undertand the error at all. Anyone could give me hand, please?

TIA,

This looks like an issue with JupyterLab and not JupyterHub, so I’ve changed the category on your topic.

Hi, I have the same issue. Did you get the solution?

Node 12 (as in the original question) appears a bit old at this time. Maybe this is the culprit? Also, do you really need to build?

Hi ~,
Thanks a lot for your reply. I am using Node 18.15, webpack 5.81.0 webpack-cli 5.0.2. Please see the log info below:
[LabBuildApp] Building in /Users/shanksdang/opt/anaconda3/envs/test/share/jupyter/lab
[LabBuildApp] Node v18.15.0

[LabBuildApp] Yarn configuration loaded.
[LabBuildApp] Building jupyterlab assets (production, minimized)
[LabBuildApp] > node /Users/shanksdang/opt/anaconda3/envs/test/lib/python3.10/site-packages/jupyterlab/staging/yarn.js install --non-interactive
[LabBuildApp] yarn install v1.21.1
warning …/…/…/…/…/…/…/…/package.json: No license field
[1/5] Validating package.json…
[2/5] Resolving packages…
success Already up-to-date.
Done in 0.17s.

[LabBuildApp] > node /Users/shanksdang/opt/anaconda3/envs/test/lib/python3.10/site-packages/jupyterlab/staging/yarn.js yarn-deduplicate -s fewer --fail
[LabBuildApp] yarn run v1.21.1
warning …/…/…/…/…/…/…/…/package.json: No license field
$ /Users/shanksdang/opt/anaconda3/envs/test/share/jupyter/lab/staging/node_modules/.bin/yarn-deduplicate -s fewer --fail
Done in 0.37s.

[LabBuildApp] > node /Users/shanksdang/opt/anaconda3/envs/test/lib/python3.10/site-packages/jupyterlab/staging/yarn.js run build:prod:minimize
[LabBuildApp] yarn run v1.21.1
warning …/…/…/…/…/…/…/…/package.json: No license field
$ webpack --config webpack.prod.minimize.config.js
[webpack-cli] /Users/shanksdang/opt/anaconda3/envs/test/share/jupyter/lab/staging/node_modules/webpack/lib/cli.js:67
/(\p{Uppercase_Letter}+|\p{Lowercase_Letter}|\d)(\p{Uppercase_Letter}+)/gu,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

SyntaxError: Invalid regular expression: /(\p{Uppercase_Letter}+|\p{Lowercase_Letter}|\d)(\p{Uppercase_Letter}+)/: Invalid property name
at new Script (node:vm:100:7)
at NativeCompileCache._moduleCompile (/Users/shanksdang/opt/anaconda3/envs/test/share/jupyter/lab/staging/node_modules/v8-compile-cache/v8-compile-cache.js:240:18)
at Module._compile (/Users/shanksdang/opt/anaconda3/envs/test/share/jupyter/lab/staging/node_modules/v8-compile-cache/v8-compile-cache.js:184:36)
at Module._extensions…js (node:internal/modules/cjs/loader:1308:10)
at Module.load (node:internal/modules/cjs/loader:1117:32)
at Module._load (node:internal/modules/cjs/loader:958:12)
at Module.require (node:internal/modules/cjs/loader:1141:19)
at require (/Users/shanksdang/opt/anaconda3/envs/test/share/jupyter/lab/staging/node_modules/v8-compile-cache/v8-compile-cache.js:159:20)
at get cli (/Users/shanksdang/opt/anaconda3/envs/test/share/jupyter/lab/staging/node_modules/webpack/lib/index.js:120:10)
at Function.cli (/Users/shanksdang/opt/anaconda3/envs/test/share/jupyter/lab/staging/node_modules/webpack/lib/util/memoize.js:22:13)
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 “/Users/shanksdang/opt/anaconda3/envs/test/lib/python3.10/site-packages/jupyterlab/debuglog.py”, line 47, in debug_logging
yield

[LabBuildApp] File “/Users/shanksdang/opt/anaconda3/envs/test/lib/python3.10/site-packages/jupyterlab/labapp.py”, line 196, in start
raise e

[LabBuildApp] File “/Users/shanksdang/opt/anaconda3/envs/test/lib/python3.10/site-packages/jupyterlab/labapp.py”, line 187, in start
build(

[LabBuildApp] File “/Users/shanksdang/opt/anaconda3/envs/test/lib/python3.10/site-packages/jupyterlab/commands.py”, line 506, in build
return handler.build(

[LabBuildApp] File “/Users/shanksdang/opt/anaconda3/envs/test/lib/python3.10/site-packages/jupyterlab/commands.py”, line 722, in build
raise RuntimeError(msg)

[LabBuildApp] RuntimeError: JupyterLab failed to build

[LabBuildApp] Exiting application: JupyterLab