Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jupyter lab failed to build #9698

Closed
kevinalexandr19 opened this issue Jan 29, 2021 · 53 comments · Fixed by #9709
Closed

Jupyter lab failed to build #9698

kevinalexandr19 opened this issue Jan 29, 2021 · 53 comments · Fixed by #9709
Labels
status:resolved-locked Closed issues are locked after 30 days inactivity. Please open a new issue for related discussion.
Milestone

Comments

@kevinalexandr19
Copy link

kevinalexandr19 commented Jan 29, 2021

Description

Jupyter lab failed to build

Reproduce

When I open jupyter-lab, it asks for build:

JupyterLab build is suggested:
algorithmx-jupyter needs to be included in build
ipyturtle2 needs to be included in build
jupyter-threejs needs to be included in build

Then I ran jupyter lab build and got:

C:\Users\Kevin>jupyter lab build
[LabBuildApp] JupyterLab 3.0.6
[LabBuildApp] Building in c:\python\share\jupyter\lab
[LabBuildApp] Building jupyterlab assets (production, minimized)
Build failed.
Troubleshooting: If the build failed due to an out-of-memory error, you
may be able to fix it by disabling the dev_build and/or minimize options.

If you are building via the jupyter lab build command, you can disable
these options like so:

jupyter lab build --dev-build=False --minimize=False

You can also disable these options for all JupyterLab builds by adding these
lines to a Jupyter config file named jupyter_config.py:

c.LabBuildApp.minimize = False
c.LabBuildApp.dev_build = False

If you don't already have a jupyter_config.py file, you can create one by
adding a blank file of that name to any of the Jupyter config directories.
The config directories can be listed by running:

jupyter --paths

Explanation:

  • dev-build: This option controls whether a dev or a more streamlined
    production build is used. This option will default to False (i.e., the
    production build) for most users. However, if you have any labextensions
    installed from local files, this option will instead default to True.
    Explicitly setting dev-build to False will ensure that the production
    build is used in all circumstances.

  • minimize: This option controls whether your JS bundle is minified
    during the Webpack build, which helps to improve JupyterLab's overall
    performance. However, the minifier plugin used by Webpack is very memory
    intensive, so turning it off may help the build finish successfully in
    low-memory environments.

An error occured.
RuntimeError: JupyterLab failed to build
See the log file for details: C:\Users\Kevin\AppData\Local\Temp\jupyterlab-debug-cztmopjy.log

Content of log file:

[LabBuildApp] Building in c:\python\share\jupyter\lab
[LabBuildApp] Node v15.7.0

[LabBuildApp] Yarn configuration loaded.
[LabBuildApp] Building jupyterlab assets (production, minimized)
[LabBuildApp] > node c:\python\lib\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.40s.

[LabBuildApp] > node c:\python\lib\site-packages\jupyterlab\staging\yarn.js yarn-deduplicate -s fewer --fail
[LabBuildApp] yarn run v1.21.1
$ c:\python\share\jupyter\lab\staging\node_modules.bin\yarn-deduplicate -s fewer --fail
Done in 0.31s.

[LabBuildApp] > node c:\python\lib\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] �[31mTypeError: The 'compilation' argument must be an instance of Compilation
at Function.getCompilationHooks c:\python\share\jupyter\lab\staging\node_modules\webpack\lib\javascript\JavascriptModulesPlugin.js:119:10)
at c:\python\share\jupyter\lab\staging\node_modules\terser-webpack-plugin\dist\index.js:566:67
at _next36 (eval at create (c:\Python\share\jupyter\lab\staging\node_modules\tapable\lib\HookCodeFactory.js:19:10), :40:1)
at _next14 (eval at create (c:\Python\share\jupyter\lab\staging\node_modules\tapable\lib\HookCodeFactory.js:19:10), :97:1)
at Hook.eval [as call] (eval at create (c:\Python\share\jupyter\lab\staging\node_modules\tapable\lib\HookCodeFactory.js:19:10), :129:1)
at Hook.CALL_DELEGATE [as _call] (c:\Python\share\jupyter\lab\staging\node_modules\tapable\lib\Hook.js:14:14)
at Compiler.newCompilation (c:\Python\share\jupyter\lab\staging\node_modules\webpack\lib\Compiler.js:993:26)
at c:\Python\share\jupyter\lab\staging\node_modules\webpack\lib\Compiler.js:1035:29
at Hook.eval [as callAsync] (eval at create (c:\Python\share\jupyter\lab\staging\node_modules\tapable\lib\HookCodeFactory.js:33:10), :6:1)
at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (c:\Python\share\jupyter\lab\staging\node_modules\tapable\lib\Hook.js:18:14)�[39m
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
[LabBuildApp] Traceback (most recent call last):

[LabBuildApp] File "c:\python\lib\site-packages\jupyterlab\debuglog.py", line 47, in debug_logging
yield

[LabBuildApp] File "c:\python\lib\site-packages\jupyterlab\labapp.py", line 168, in start
raise e

[LabBuildApp] File "c:\python\lib\site-packages\jupyterlab\labapp.py", line 164, in start
build(name=self.name, version=self.version,

[LabBuildApp] File "c:\python\lib\site-packages\jupyterlab\commands.py", line 463, in build
return handler.build(name=name, version=version, static_url=static_url,

[LabBuildApp] File "c:\python\lib\site-packages\jupyterlab\commands.py", line 675, in build
raise RuntimeError(msg)

[LabBuildApp] RuntimeError: JupyterLab failed to build

[LabBuildApp] Exiting application: JupyterLab

Webpack-related problem

@jasongrout suggested the use of jlpm why webpack to track the origin of the problem, hence, I ran that command inside the staging subdirectory of jupyterlab and obtained this:

C:\Python\share\jupyter\lab\staging>jlpm why webpack
yarn why v1.21.1
[1/4] Why do we have the module "webpack"...?
[2/4] Initialising dependency graph...
[3/4] Finding dependency...
[4/4] Calculating file sizes...
=> Found "webpack@5.18.0"
info Has been hoisted to "webpack"
info Reasons this module exists

  • Specified in "devDependencies"
  • Hoisted from "@jupyterlab#builder#webpack"

info Disk size without dependencies: "5.9MB"
info Disk size with unique dependencies: "9.7MB"
info Disk size with transitive dependencies: "22.77MB"
info Number of shared dependencies: 55
Done in 0.61s.

Expected behavior

A successful build was expected since webpack problem was corrected for jupyterlab 3.0.6 (#9651)

Context

  • Operating System and version: Windows 10 Pro
  • Browser and Version: Brave v 1.19.88 Chromium: 88.0.4324.96
  • JupyterLab version: 3.0.6
  • Node.js version: 15.7.0
  • Python version: 3.8.5
  • All python packages were installed using pip

Note

I am able to use JupyterLab prebuilt extensions normally. But since jupyter lab build fails, I cannot use the source extensions for JupyterLab.

@jasongrout
Copy link
Contributor

Thanks for the comprehensive error report. Are you sure all of the source extensions are updated for jlab 3?

@jasongrout
Copy link
Contributor

Can you uninstall the source extensions, then install them one at a time to see which one might be causing issues (or is there still an error if you build with no source extensions)?

@kevinalexandr19
Copy link
Author

kevinalexandr19 commented Jan 29, 2021

Can you uninstall the source extensions, then install them one at a time to see which one might be causing issues (or is there still an error if you build with no source extensions)?

Extension list from jupyterlab:

C:\Users\Kevin>jupyter labextension list
JupyterLab v3.0.6
c:\python\share\jupyter\labextensions
bqplot v0.5.21 enabled ok
jupyter-matplotlib v0.8.3 enabled ok
jupyterlab-datawidgets v7.0.0 enabled ok
@jupyter-widgets/jupyterlab-manager v3.0.0 enabled ok (python, jupyterlab_widgets)
@pyviz/jupyterlab_pyviz v2.0.1 enabled ok (python, pyviz_comms)
@voila-dashboards/jupyterlab-preview v2.0.0 enabled ok (python, voila)

Other labextensions (built into JupyterLab)
app dir: c:\python\share\jupyter\lab
algorithmx-jupyter v3.0.0 enabled ok
ipyturtle2 v0.1.0 enabled ok
jupyter-threejs v2.2.0 enabled ok

Build recommended, please run jupyter lab build:
algorithmx-jupyter needs to be included in build
ipyturtle2 needs to be included in build
jupyter-threejs needs to be included in build

I will uninstall source extensions now and try jupyter lab build

@kevinalexandr19
Copy link
Author

It seems JupyterLab automatically executes jupyter lab build after I execute jupyter labextension uninstall extension1 extension2 extension3, but still fails doing it.
I executed jupyter lab build manually with prebuilt extensions only and still got the same webpack error. So I think maybe this bug is not related to source extensions.

@jasongrout
Copy link
Contributor

Now that all source extensions are uninstalled (please check to make sure with jupyter labextension list), can you do jupyter lab clean, then do a jupyter lab build?

@kevinalexandr19
Copy link
Author

Now that all source extensions are uninstalled (please check to make sure with jupyter labextension list), can you do jupyter lab clean, then do a jupyter lab build?

Okay.

  1. Executing jupyter labextension list:

C:\Users\Kevin>jupyter labextension list
JupyterLab v3.0.6
c:\python\share\jupyter\labextensions
bqplot v0.5.21 enabled ok
jupyter-matplotlib v0.8.3 enabled ok
jupyterlab-datawidgets v7.0.0 enabled ok
@jupyter-widgets/jupyterlab-manager v3.0.0 enabled ok (python, jupyterlab_widgets)
@pyviz/jupyterlab_pyviz v2.0.1 enabled ok (python, pyviz_comms)
@voila-dashboards/jupyterlab-preview v2.0.0 enabled ok (python, voila)

Other labextensions (built into JupyterLab)
app dir: c:\python\share\jupyter\lab

  1. Executing jupyter lab clean:

C:\Users\Kevin>jupyter lab clean
[LabCleanApp] Cleaning c:\python\share\jupyter\lab...
[LabCleanApp] Removing staging...
[LabCleanApp] Success!

  1. Executing jupyter lab build:

[LabBuildApp] JupyterLab 3.0.6
[LabBuildApp] Building in c:\python\share\jupyter\lab
[LabBuildApp] Building jupyterlab assets (production, minimized)
Build failed.
... ... ....
An error occured.
RuntimeError: JupyterLab failed to build
See the log file for details: C:\Users\Kevin\AppData\Local\Temp\jupyterlab-debug-cozrrrv_.log

  1. Conclusion:
    Failed, with the same error related to Webpack and Compilation.

.... ....
[webpack-cli] �[31mTypeError: The 'compilation' argument must be an instance of Compilation
.... ....

@jasongrout
Copy link
Contributor

This is indeed puzzling, then. And just to check, jlpm why webpack in this new clean staging directory still only lists one webpack, not two?

@jasongrout
Copy link
Contributor

jasongrout commented Jan 29, 2021

FYI, here is the place in the webpack code that seems to be throwing the error: https://github.com/webpack/webpack/blob/89fcc43bdaa956efc2fa1b0dfed596386a8aeba9/lib/javascript/JavascriptModulesPlugin.js#L120

@kevinalexandr19
Copy link
Author

This is indeed puzzling, then. And just to check, jlpm why webpack in this new clean staging directory still only lists one webpack, not two?

Executing jlpm why webpack:

C:\Python\share\jupyter\lab\staging>jlpm why webpack
yarn why v1.21.1
[1/4] Why do we have the module "webpack"...?
[2/4] Initialising dependency graph...
[3/4] Finding dependency...
[4/4] Calculating file sizes...
=> Found "webpack@5.18.0"
info Has been hoisted to "webpack"
info Reasons this module exists

  • Specified in "devDependencies"
  • Hoisted from "@jupyterlab#builder#webpack"

info Disk size without dependencies: "5.9MB"
info Disk size with unique dependencies: "9.7MB"
info Disk size with transitive dependencies: "22.77MB"
info Number of shared dependencies: 55
Done in 0.70s.

Thanks for the link.

@kevinalexandr19
Copy link
Author

kevinalexandr19 commented Jan 29, 2021

FYI, here is the place in the webpack code that seems to be throwing the error: https://github.com/webpack/webpack/blob/89fcc43bdaa956efc2fa1b0dfed596386a8aeba9/lib/javascript/JavascriptModulesPlugin.js#L120

I also found that installing Node.js through official website also installs npm (which I have but npm list is empty), but jupyterlab seems to use yarn. So, is there any conflict in using both package managers?

@jasongrout
Copy link
Contributor

So, is there any conflict in using both package managers?

No, not really in this case. yarn uses npm packages.

@jasongrout
Copy link
Contributor

Maybe this has to do with windows?

Do you get this error with a clean fresh environment and install of just basic jupyterlab with no extensions (source or prebuilt)?

@kevinalexandr19
Copy link
Author

kevinalexandr19 commented Jan 29, 2021

Maybe this has to do with windows?

Do you get this error with a clean fresh environment and install of just basic jupyterlab with no extensions (source or prebuilt)?

Today I reinstalled python from zero, and every package was installed using pip (pip install jupyterlab), but it seems that this extensions (source and prebuilt) were installed inside jupyterlab by default, unless maybe there is some sort of old registry that keeps installing those extensions even if I reinstall python from zero.

I also pip-installed algorithmx, ipyturtle2 and pythreejs before doing lab build, but not their jupyterlab extensions.

@spindensity
Copy link

The same error here with a totally new virtual environment.

Environment

  • OS: Windows 10 20H2 64bit;
  • Python: 3.8.6 64bit;
  • npm: 6.14.10 (system wide).

Steps to reproduce

python -m venv jupyterlab_test
jupyterlab_test\Scripts\activate.bat
python -m pip install --upgrade pip
pip install jupyterlab
jupyter lab build

Error log

[LabBuildApp] Building in c:\dev\basictools\python\virtualenvs\jupyterlab_test\share\jupyter\lab
[LabBuildApp] Node v14.15.4

[LabBuildApp] Yarn configuration loaded.
[LabBuildApp] Building jupyterlab assets (production, minimized)
[LabBuildApp] > node c:\dev\basictools\python\virtualenvs\jupyterlab_test\lib\site-packages\jupyterlab\staging\yarn.js install --non-interactive
[LabBuildApp] yarn install v1.21.1
[1/5] Validating package.json...
[2/5] Resolving packages...
[3/5] Fetching packages...
info fsevents@2.3.1: The platform "win32" is incompatible with this module.
info "fsevents@2.3.1" is an optional dependency and failed compatibility check. Excluding it from installation.
[4/5] Linking dependencies...
warning "@jupyterlab/extensionmanager > react-paginate@6.5.0" has incorrect peer dependency "react@^16.0.0".
warning "@jupyterlab/json-extension > react-highlighter@0.4.3" has incorrect peer dependency "react@^0.14.0 || ^15.0.0 || ^16.0.0".
warning "@jupyterlab/json-extension > react-json-tree@0.12.1" has incorrect peer dependency "react@^16.3.0".
warning "@jupyterlab/json-extension > react-json-tree@0.12.1" has incorrect peer dependency "react-dom@^16.3.0".
warning "@jupyterlab/ui-components > @blueprintjs/core > react-popper@1.3.7" has incorrect peer dependency "react@0.14.x || ^15.0.0 || ^16.0.0".
warning "@jupyterlab/ui-components > @blueprintjs/core > react-popper > create-react-context@0.3.0" has incorrect peer dependency "react@^0.14.0 || ^15.0.0 || ^16.0.0".
warning "@jupyterlab/vdom > @nteract/transform-vdom@4.0.16-alpha.0" has incorrect peer dependency "react@^16.3.2".
warning " > @lumino/coreutils@1.5.3" has unmet peer dependency "crypto@1.0.1".
[5/5] Building fresh packages...
Done in 19.73s.

[LabBuildApp] > node c:\dev\basictools\python\virtualenvs\jupyterlab_test\lib\site-packages\jupyterlab\staging\yarn.js yarn-deduplicate -s fewer --fail
[LabBuildApp] yarn run v1.21.1
$ c:\dev\basictools\python\virtualenvs\jupyterlab_test\share\jupyter\lab\staging\node_modules\.bin\yarn-deduplicate -s fewer --fail
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

[LabBuildApp] > node c:\dev\basictools\python\virtualenvs\jupyterlab_test\lib\site-packages\jupyterlab\staging\yarn.js
[LabBuildApp] yarn install v1.21.1
[1/5] Validating package.json...
[2/5] Resolving packages...
[3/5] Fetching packages...
info fsevents@2.3.1: The platform "win32" is incompatible with this module.
info "fsevents@2.3.1" is an optional dependency and failed compatibility check. Excluding it from installation.
[4/5] Linking dependencies...
warning "@jupyterlab/extensionmanager > react-paginate@6.5.0" has incorrect peer dependency "react@^16.0.0".
warning "@jupyterlab/json-extension > react-highlighter@0.4.3" has incorrect peer dependency "react@^0.14.0 || ^15.0.0 || ^16.0.0".
warning "@jupyterlab/json-extension > react-json-tree@0.12.1" has incorrect peer dependency "react@^16.3.0".
warning "@jupyterlab/json-extension > react-json-tree@0.12.1" has incorrect peer dependency "react-dom@^16.3.0".
warning "@jupyterlab/ui-components > @blueprintjs/core > react-popper@1.3.7" has incorrect peer dependency "react@0.14.x || ^15.0.0 || ^16.0.0".
warning "@jupyterlab/ui-components > @blueprintjs/core > react-popper > create-react-context@0.3.0" has incorrect peer dependency "react@^0.14.0 || ^15.0.0 || ^16.0.0".
warning "@jupyterlab/vdom > @nteract/transform-vdom@4.0.16-alpha.0" has incorrect peer dependency "react@^16.3.2".
warning " > @lumino/coreutils@1.5.3" has unmet peer dependency "crypto@1.0.1".
[5/5] Building fresh packages...
Done in 5.93s.

[LabBuildApp] > node c:\dev\basictools\python\virtualenvs\jupyterlab_test\lib\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] �[31mTypeError: The 'compilation' argument must be an instance of Compilation
    at Function.getCompilationHooks (c:\dev\basictools\python\virtualenvs\jupyterlab_test\share\jupyter\lab\staging\node_modules\webpack\lib\javascript\JavascriptModulesPlugin.js:119:10)
    at c:\dev\basictools\python\virtualenvs\jupyterlab_test\share\jupyter\lab\staging\node_modules\terser-webpack-plugin\dist\index.js:566:67
    at _next36 (eval at create (c:\Dev\BasicTools\python\virtualenvs\jupyterlab_test\share\jupyter\lab\staging\node_modules\tapable\lib\HookCodeFactory.js:19:10), <anonymous>:40:1)
    at _next14 (eval at create (c:\Dev\BasicTools\python\virtualenvs\jupyterlab_test\share\jupyter\lab\staging\node_modules\tapable\lib\HookCodeFactory.js:19:10), <anonymous>:97:1)
    at Hook.eval [as call] (eval at create (c:\Dev\BasicTools\python\virtualenvs\jupyterlab_test\share\jupyter\lab\staging\node_modules\tapable\lib\HookCodeFactory.js:19:10), <anonymous>:129:1)
    at Hook.CALL_DELEGATE [as _call] (c:\Dev\BasicTools\python\virtualenvs\jupyterlab_test\share\jupyter\lab\staging\node_modules\tapable\lib\Hook.js:14:14)
    at Compiler.newCompilation (c:\Dev\BasicTools\python\virtualenvs\jupyterlab_test\share\jupyter\lab\staging\node_modules\webpack\lib\Compiler.js:993:26)
    at c:\Dev\BasicTools\python\virtualenvs\jupyterlab_test\share\jupyter\lab\staging\node_modules\webpack\lib\Compiler.js:1035:29
    at Hook.eval [as callAsync] (eval at create (c:\Dev\BasicTools\python\virtualenvs\jupyterlab_test\share\jupyter\lab\staging\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:6:1)
    at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (c:\Dev\BasicTools\python\virtualenvs\jupyterlab_test\share\jupyter\lab\staging\node_modules\tapable\lib\Hook.js:18:14)�[39m
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
[LabBuildApp] Traceback (most recent call last):

[LabBuildApp]   File "c:\dev\basictools\python\virtualenvs\jupyterlab_test\lib\site-packages\jupyterlab\debuglog.py", line 47, in debug_logging
    yield

[LabBuildApp]   File "c:\dev\basictools\python\virtualenvs\jupyterlab_test\lib\site-packages\jupyterlab\labapp.py", line 168, in start
    raise e

[LabBuildApp]   File "c:\dev\basictools\python\virtualenvs\jupyterlab_test\lib\site-packages\jupyterlab\labapp.py", line 164, in start
    build(name=self.name, version=self.version,

[LabBuildApp]   File "c:\dev\basictools\python\virtualenvs\jupyterlab_test\lib\site-packages\jupyterlab\commands.py", line 463, in build
    return handler.build(name=name, version=version, static_url=static_url,

[LabBuildApp]   File "c:\dev\basictools\python\virtualenvs\jupyterlab_test\lib\site-packages\jupyterlab\commands.py", line 675, in build
    raise RuntimeError(msg)

[LabBuildApp] RuntimeError: JupyterLab failed to build

[LabBuildApp] Exiting application: JupyterLab

Additional information

The result of jlpm why webpack executed in staging directory:

yarn why v1.21.1
[1/4] Why do we have the module "webpack"...?
[2/4] Initialising dependency graph...
[3/4] Finding dependency...
[4/4] Calculating file sizes...
=> Found "webpack@5.18.0"
info Has been hoisted to "webpack"
info Reasons this module exists
   - Specified in "devDependencies"
   - Hoisted from "@jupyterlab#builder#webpack"
info Disk size without dependencies: "5.9MB"
info Disk size with unique dependencies: "9.7MB"
info Disk size with transitive dependencies: "22.77MB"
info Number of shared dependencies: 55
Done in 1.37s

The result of jupyter labextension list(no extension installed):

JupyterLab v3.0.6

The result of pip list(only jupyterlab and its dependencies installed):

Package             Version
------------------- ---------
anyio               2.0.2
argon2-cffi         20.1.0
async-generator     1.10
attrs               20.3.0
Babel               2.9.0
backcall            0.2.0
bleach              3.2.3
certifi             2020.12.5
cffi                1.14.4
chardet             4.0.0
colorama            0.4.4
decorator           4.4.2
defusedxml          0.6.0
entrypoints         0.3
idna                3.1
ipykernel           5.4.3
ipython             7.19.0
ipython-genutils    0.2.0
jedi                0.18.0
Jinja2              2.11.2
json5               0.9.5
jsonschema          3.2.0
jupyter-client      6.1.11
jupyter-core        4.7.0
jupyter-server      1.2.2
jupyterlab          3.0.6
jupyterlab-pygments 0.1.2
jupyterlab-server   2.1.3
MarkupSafe          1.1.1
mistune             0.8.4
nbclassic           0.2.6
nbclient            0.5.1
nbconvert           6.0.7
nbformat            5.1.2
nest-asyncio        1.5.1
notebook            6.2.0
packaging           20.8
pandocfilters       1.4.3
parso               0.8.1
pickleshare         0.7.5
pip                 21.0
prometheus-client   0.9.0
prompt-toolkit      3.0.14
pycparser           2.20
Pygments            2.7.4
pyparsing           2.4.7
pyrsistent          0.17.3
python-dateutil     2.8.1
pytz                2020.5
pywin32             300
pywinpty            0.5.7
pyzmq               22.0.0
requests            2.25.1
Send2Trash          1.5.0
setuptools          49.2.1
six                 1.15.0
sniffio             1.2.0
terminado           0.9.2
testpath            0.4.4
tornado             6.1
traitlets           5.0.5
urllib3             1.26.3
wcwidth             0.2.5
webencodings        0.5.1

The result of npm --version:

6.14.10

@spindensity
Copy link

Maybe this has to do with windows?

Do you get this error with a clean fresh environment and install of just basic jupyterlab with no extensions (source or prebuilt)?

Yes, see #9698 (comment)

@meeseeksmachine
Copy link
Contributor

This issue has been mentioned on Jupyter Community Forum. There might be relevant details there:

https://discourse.jupyter.org/t/jupyterlab-html-webpack-plugin-type-error/7695/2

@jasongrout
Copy link
Contributor

For what it's worth, I can build JupyterLab 3.0.6 in a clean conda environment on Windows 10, installed with miniconda and conda-forge packages jupyterlab=3.0.6 nodejs=14, python=3.9.

Is it the windows pip package, for some reason?

@jasongrout
Copy link
Contributor

I just tried creating a fresh conda environment on Windows 10 with just nbclassic python=3.9 nodejs=14 notebook, and then installing the pip jupyterlab 3.0.6 package, and I reproduced the 'compilation' error people are seeing with a plain jupyter lab build.

Weird that it worked with the conda-forge package, but not with the pip package.

@jasongrout
Copy link
Contributor

I just tried creating a fresh conda environment on Windows 10 with just nbclassic python=3.9 nodejs=14 notebook, and then installing the pip jupyterlab 3.0.6 package, and I reproduced the 'compilation' error people are seeing with a plain jupyter lab build.

Same experiment on macOS (conda install environment, pip install jupyterlab), and compiling worked, so it seems specific to windows...

@jasongrout
Copy link
Contributor

jasongrout commented Jan 29, 2021

More experiments (I remove the application staging directory between experiments)

  • jupyter lab build twice has the error twice in a row. However, if I cd into the application staging directory, then do jupyter lab build there, it works!
  • jlpm run build:prod:minimize works if run from the staging directory
  • Running with --minimize=False --dev-build still had errors
  • Commenting out adding extensionAssetConfig to the webpack config fixes the error:
    ].concat(extensionAssetConfig);
  • Deleting MiniCssExtractPlugin.loader, here fixes the error as well:
    use: [MiniCssExtractPlugin.loader, 'css-loader']

@jasongrout
Copy link
Contributor

From the experiments, my current hypothesis is that there is a path or working directory issue going on, where creating the MiniCssExtractPlugin.loader from a directory outside the staging directory is somehow creating something using a different copy of the webpack compilation object.

  • It seems pretty clear that the problem has something to do with the MiniCssExtractPlugin.loader in the jlab builder build.ts
  • Since running jupyter lab build in the staging directory works, but doesn't work outside the staging directory, likely there is some path issue that is somehow causing us to pick up a different webpack import there.

@jasongrout
Copy link
Contributor

As a test, @spindensity (or others) - can you try doing a cd into the jupyterlab application directory, staging subdirectory, then running jupyter lab build from inside that staging directory?

@spindensity
Copy link

As a test, @spindensity (or others) - can you try doing a cd into the jupyterlab application directory, staging subdirectory, then running jupyter lab build from inside that staging directory?

Yes, it works, running jupyter lab build with staging directory as the current working directory could be a workaround.

@kevinalexandr19
Copy link
Author

As a test, @spindensity (or others) - can you try doing a cd into the jupyterlab application directory, staging subdirectory, then running jupyter lab build from inside that staging directory?

Running jupyter lab build inside staging subdirectory seems to work for me aswell.

C:\Python\share\jupyter\lab\staging>jupyter lab build
[LabBuildApp] JupyterLab 3.0.6
[LabBuildApp] Building in c:\python\share\jupyter\lab
[LabBuildApp] Building jupyterlab assets (production, minimized)
\

I hope it works for everyone with the webpack Compilation problem.

@jasongrout
Copy link
Contributor

I spent a lot of time over the last 24 hours diving into this, discussed this with various people about it, etc. I'm still really puzzled by it:

  • The error only seems to happen if you are using Windows, installing JLab via pip (not conda), and doing jupyter lab build outside of the application staging directory. Installing using conda, compiling inside the staging directory both seem to fix the issue.
  • I've put in a lot of printf debugging statements to try to understand better what is calling what and where this compilation object is coming from. As far as I can tell, the correct files are always getting loaded and referenced - it doesn't seem to be a case of having a duplicate package.

The current hypothesis is that somehow node/webpack is importing the same copy of some file twice (perhaps not caching the import?), and that is causing the mismatch (i.e., the compilation object created from one import is not an instanceof the compilation object in the second copy). It's not clear how this could be happening, though.

To address the directory issue, we've tried making sure the build had the correct current working directory, but that did not seem to help.

@jasongrout
Copy link
Contributor

I found the problem: it is the case sensitivity of the filesystem and the case of the files.

Node's require() caches modules based on their filename, case sensitive. In my case, I'm seeing two different imports of webpack: one is C:\Users..., the other is c:\users.... The lower-case import is the main program. However, when node loads mini-css-extract-plugin, it loads the C:\Users uppercase version.

So it looks like the main program loads eventually c:\users\...\loader-runner\lib\loadLoader.js, which in turn loads C:\Users\...\mini-css-extract-plugin\dist\loader.js, which starts importing things from webpack, but starting with C:\Users (upper-case), which creates a lot more imports. I think this is where the problem happens, since this import chain eventually imports C:\Users\...\Compilation.js, which does not match the compilation object being passed around in webpack.

@kevinalexandr19
Copy link
Author

Interesting, I have little to null experience in software development but reading through your comments makes me understand the situation at least in a basic level. Thanks for the clarification.

@jasongrout
Copy link
Contributor

Diving more into this, I'm looking at the case of the drive letter on Windows. I'm seeing that jupyter lab path has a lowercase application directory drive letter, but upper case for other paths. This may be part of the problem - it seems that we are launching node with a lowercase drive letter, but when node is resolving paths, it uses an upper case drive letter.

It seems that core jupyter application has an uppercase drive letter in __file__ and sys.prefix, but when it launches, say, jupyter-lab.exe with popen (using an upper-case drive letter), the jupyter-lab application has a lowercase drive letter for __file__ and sys.prefix.

Some experiments with subprocess suggest that launching an application with an uppercase drive letter should give an uppercase __file__ and sys.prefix in the launched application, so I'm not sure what is going on.

jasongrout added a commit to jasongrout/jupyterlab that referenced this issue Jan 30, 2021
This fixes `jupyter lab build` on Windows when using pip. The underlying problem is in pip (from its dependency distlib) and how it normalizes paths to lowercase when it creates executables for Windows entry points (see https://bitbucket.org/pypa/distlib/issues/143/do-not-normcase-executable-path-when and pypa/pip#6582 (comment)). Basically, when we set the current working directory to a lower-case version of the path, node starts using the lower-case version for its module cache when building JupyterLab. However, the mini-css-extract plugin in JLab asks node to resolve a path for its loader, which uses the canonical case for the path. This leads to Node having two copies of the same modules in its cache (differentiated by the path case), which leads to problems when doing instanceof checks. See the exploration at jupyterlab#9698 for more details.

Until the issue is fixed in distlib/pip, we can work around it by using realpath, which seems to give back a canonical name (including case) for a path. It’s possible that we should use realpath many more places in the code, but it seems that this change is minimal enough to at least get the windows build working, and I want to be conservative here.

You can see the effect of this change by installing jupyterlab with (current) pip on Windows and running `jupyter lab path`. You’ll notice that the application directory is lowercase before this commit, but normal case after (e.g., the drive letter is uppercase, etc.).
jasongrout added a commit to jasongrout/jupyterlab that referenced this issue Jan 30, 2021
Fixes jupyterlab#9698

This fixes `jupyter lab build` on Windows when using pip. The underlying problem is in pip (from its dependency distlib) and how it normalizes paths to lowercase when it creates executables for Windows entry points (see https://bitbucket.org/pypa/distlib/issues/143/do-not-normcase-executable-path-when and pypa/pip#6582 (comment)). Basically, when we set the current working directory to a lower-case version of the path, node starts using the lower-case version for its module cache when building JupyterLab. However, the mini-css-extract plugin in JLab asks node to resolve a path for its loader, which uses the canonical case for the path. This leads to Node having two copies of the same modules in its cache (differentiated by the path case), which leads to problems when doing instanceof checks. See the exploration at jupyterlab#9698 for more details.

Until the issue is fixed in distlib/pip, we can work around it by using realpath, which seems to give back a canonical name (including case) for a path. It’s possible that we should use realpath many more places in the code, but it seems that this change is minimal enough to at least get the windows build working, and I want to be conservative here.

You can see the effect of this change by installing jupyterlab with (current) pip on Windows and running `jupyter lab path`. You’ll notice that the application directory is lowercase before this commit, but normal case after (e.g., the drive letter is uppercase, etc.).
@jasongrout
Copy link
Contributor

I think I found a workaround for the pip issue in #9709.

jasongrout added a commit to jasongrout/jupyterlab that referenced this issue Jan 31, 2021
Fixes jupyterlab#9698

This fixes `jupyter lab build` on Windows when using pip. The underlying problem is in pip (from its dependency distlib) and how it normalizes paths to lowercase when it creates executables for Windows entry points (see https://bitbucket.org/pypa/distlib/issues/143/do-not-normcase-executable-path-when and pypa/pip#6582 (comment)). Basically, when we set the current working directory to a lower-case version of the path, node starts using the lower-case version for its module cache when building JupyterLab. However, the mini-css-extract plugin in JLab asks node to resolve a path for its loader, which uses the canonical case for the path. This leads to Node having two copies of the same modules in its cache (differentiated by the path case), which leads to problems when doing instanceof checks. See the exploration at jupyterlab#9698 for more details.

Until the issue is fixed in distlib/pip, we can work around it by using Path.resolve(), which seems to give back a canonical name (including case) for a path. It’s possible that we should use this many more places in the code, but it seems that this change is minimal enough to at least get the windows build working, and I want to be conservative here.

We initially tried using os.path.realpath, and while that works on python 3.9, it does not correct case on python 3.6.

You can see the effect of this change by installing jupyterlab with (current) pip on Windows and running `jupyter lab path`. You’ll notice that the application directory is lowercase before this commit, but normal case after (e.g., the drive letter is uppercase, etc.).
@jasongrout
Copy link
Contributor

I can confirm that the fix in #9709 fixes the same error in the now-running Windows CI test.

@jasongrout jasongrout modified the milestones: 3.1, 3.0 Jan 31, 2021
@callmesukhi
Copy link

@jasongrout I tried everything mentioned in this thread, but I still get build fail.

@jasongrout
Copy link
Contributor

@callmesukhi, welcome to this issue! The first thing to determine is if you are having the problem that this issue is about (and if not, please open a new issue). Can you give us the information requested in the bug report issue template, like info about your version of JupyterLab, OS, etc., and why you think your issue is exactly the same as the issue we are discussing here?

Then please tell us exactly what you've tried from this thread that doesn't seem to be working.

Also, it might help to go through the troubleshooting/diagnosis guide in the documentation at https://jupyterlab.readthedocs.io/en/stable/getting_started/issue.html to try to narrow down the problem.

@jasongrout
Copy link
Contributor

jasongrout commented Feb 2, 2021

Summarizing workarounds until JupyterLab 3.0.7 is published soon. Do one of the following:

  1. Run the build with python -m jupyterlab.labapp build
  2. Run the build within the application staging directory (i.e., the application directory from jupyter lab path, inside the staging directory
  3. Use conda instead of pip
  4. Use a different operating system than Windows

@mkery
Copy link

mkery commented Feb 2, 2021

Thank you @jasongrout for a workaround! Had a study participant try to install my JupyterLab extension on a windows machine last night and ran into this issue, completely halting the study 😢 . Came here from #9649

Running steps 1 and 2 above on a windows machine worked!

@jasongrout
Copy link
Contributor

Awesome, good to hear from you, Mary Beth! Glad it worked, and hopefully 3.0.7 will be out today or tomorrow to work around the pip/distlib bug and make things work.

@blink1073
Copy link
Member

https://pypi.org/project/jupyterlab/3.0.7/ is now available

@jasongrout
Copy link
Contributor

And to follow-up on the pypi issue: the distlib fix for the underlying issue was made, and pypi put the fix in the queue for their 21.1 release, targeted for April 2021. The workaround in JLab 3.0.7 should make it just work right now, though.

@allenhutao
Copy link

I tried steps 1 and 2 above on a windows, but I still fail to build.
So,I really need some help.
Here are some information.

jupyter core : 4.7.0
jupyter-notebook : 6.2.0
qtconsole : 5.0.1
ipython : 7.19.0
ipykernel : 5.4.2
jupyter client : 6.1.7
jupyter lab : 3.0.0
nbconvert : 6.0.7
ipywidgets : 7.6.2
nbformat : 5.0.8
traitlets : 5.0.5

(base) C:\Users\lenovo\miniconda3\share\jupyter\lab\staging>jlpm why webpack
yarn why v1.21.1
warning ..........\package.json: No license field
[1/4] Why do we have the module "webpack"...?
[2/4] Initialising dependency graph...
[3/4] Finding dependency...
[4/4] Calculating file sizes...
=> Found "webpack@5.23.0"
info Has been hoisted to "webpack"
info Reasons this module exists

  • Specified in "devDependencies"
  • Hoisted from "@jupyterlab#builder#webpack"
    info Disk size without dependencies: "6.3MB"
    info Disk size with unique dependencies: "10.63MB"
    info Disk size with transitive dependencies: "23.7MB"
    info Number of shared dependencies: 95
    => Found "react-scripts#webpack@4.29.6"
    info This module exists because "@Elyra#pipeline-editor-extension#react-scripts" depends on it.
    info Disk size without dependencies: "2.21MB"
    info Disk size with unique dependencies: "8.64MB"
    info Disk size with transitive dependencies: "25.2MB"
    info Number of shared dependencies: 129
    Done in 8.49s.

(base) C:\Users\lenovo\miniconda3\share\jupyter\lab\staging>jlpm why webpack
yarn why v1.21.1
warning ..........\package.json: No license field
[1/4] Why do we have the module "webpack"...?
[2/4] Initialising dependency graph...
[3/4] Finding dependency...
[4/4] Calculating file sizes...
=> Found "webpack@5.23.0"
info Has been hoisted to "webpack"
info Reasons this module exists

  • Specified in "devDependencies"
  • Hoisted from "@jupyterlab#builder#webpack"
    info Disk size without dependencies: "6.3MB"
    info Disk size with unique dependencies: "10.63MB"
    info Disk size with transitive dependencies: "23.7MB"
    info Number of shared dependencies: 95
    => Found "react-scripts#webpack@4.29.6"
    info This module exists because "@Elyra#pipeline-editor-extension#react-scripts" depends on it.
    info Disk size without dependencies: "2.21MB"
    info Disk size with unique dependencies: "8.64MB"
    info Disk size with transitive dependencies: "25.2MB"
    info Number of shared dependencies: 129
    Done in 8.49s.
    (base) C:\Users\lenovo\miniconda3\share\jupyter\lab\staging>jupyter lab build
    [LabBuildApp] JupyterLab 3.0.9
    [LabBuildApp] Building in C:\Users\lenovo\miniconda3\share\jupyter\lab
    [LabBuildApp] Building jupyterlab assets (production, minimized)
    [LabBuildApp] WARNING | The extension "@jupyterlab/git" is outdated.

Build failed.
Troubleshooting: If the build failed due to an out-of-memory error, you
may be able to fix it by disabling the dev_build and/or minimize options.

If you are building via the jupyter lab build command, you can disable
these options like so:

jupyter lab build --dev-build=False --minimize=False

You can also disable these options for all JupyterLab builds by adding these
lines to a Jupyter config file named jupyter_config.py:

c.LabBuildApp.minimize = False
c.LabBuildApp.dev_build = False

If you don't already have a jupyter_config.py file, you can create one by
adding a blank file of that name to any of the Jupyter config directories.
The config directories can be listed by running:

jupyter --paths

Explanation:

  • dev-build: This option controls whether a dev or a more streamlined
    production build is used. This option will default to False (i.e., the
    production build) for most users. However, if you have any labextensions
    installed from local files, this option will instead default to True.
    Explicitly setting dev-build to False will ensure that the production
    build is used in all circumstances.

  • minimize: This option controls whether your JS bundle is minified
    during the Webpack build, which helps to improve JupyterLab's overall
    performance. However, the minifier plugin used by Webpack is very memory
    intensive, so turning it off may help the build finish successfully in
    low-memory environments.

An error occured.
RuntimeError: JupyterLab failed to build
See the log file for details: C:\Users\lenovo\AppData\Local\Temp\jupyterlab-debug-4lud7a6b.log

[LabBuildApp] Building in C:\Users\lenovo\miniconda3\share\jupyter\lab
[LabBuildApp] Node v15.10.0

[LabBuildApp] Yarn configuration loaded.
[LabBuildApp] Building jupyterlab assets (production, minimized)
[LabBuildApp] WARNING | The extension "@jupyterlab/git" is outdated.

[LabBuildApp] > node C:\Users\lenovo\miniconda3\lib\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 7.07s.

[LabBuildApp] > node C:\Users\lenovo\miniconda3\lib\site-packages\jupyterlab\staging\yarn.js yarn-deduplicate -s fewer --fail
[LabBuildApp] yarn run v1.21.1
warning ..........\package.json: No license field
$ C:\Users\lenovo\miniconda3\share\jupyter\lab\staging\node_modules.bin\yarn-deduplicate -s fewer --fail
Done in 4.34s.

[LabBuildApp] > node C:\Users\lenovo\miniconda3\lib\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] �[31mModuleNotFoundError: Module not found: Error: Can't resolve '.\jquery.js' in 'C:\Users\lenovo\miniconda3\share\jupyter\lab\staging\node_modules\jquery\dist'
Did you mean './.\jquery.js'?
Requests that should resolve in the current directory need to start with './'.
Requests that start with a name are treated as module requests and resolve within module directories (node_modules).
If changing the source code is not an option there is also a resolve options called 'preferRelative' which tries to resolve these kind of requests in the current directory too.
at C:\Users\lenovo\miniconda3\share\jupyter\lab\staging\node_modules\webpack\lib\Compilation.js:1657:28
at C:\Users\lenovo\miniconda3\share\jupyter\lab\staging\node_modules\webpack\lib\NormalModuleFactory.js:708:13
at eval (eval at create (C:\Users\lenovo\miniconda3\share\jupyter\lab\staging\node_modules\webpack\node_modules\tapable\lib\HookCodeFactory.js:33:10), :10:1)
at C:\Users\lenovo\miniconda3\share\jupyter\lab\staging\node_modules\webpack\lib\NormalModuleFactory.js:272:22
at eval (eval at create (C:\Users\lenovo\miniconda3\share\jupyter\lab\staging\node_modules\webpack\node_modules\tapable\lib\HookCodeFactory.js:33:10), :9:1)
at C:\Users\lenovo\miniconda3\share\jupyter\lab\staging\node_modules\webpack\lib\NormalModuleFactory.js:401:22
at C:\Users\lenovo\miniconda3\share\jupyter\lab\staging\node_modules\webpack\lib\NormalModuleFactory.js:118:11
at C:\Users\lenovo\miniconda3\share\jupyter\lab\staging\node_modules\webpack\lib\NormalModuleFactory.js:632:24
at C:\Users\lenovo\miniconda3\share\jupyter\lab\staging\node_modules\webpack\lib\NormalModuleFactory.js:774:8
at C:\Users\lenovo\miniconda3\share\jupyter\lab\staging\node_modules\webpack\lib\NormalModuleFactory.js:894:5
resolve '.\jquery.js' in 'C:\Users\lenovo\miniconda3\share\jupyter\lab\staging\node_modules\jquery\dist'
Parsed request is a module
using description file: C:\Users\lenovo\miniconda3\share\jupyter\lab\staging\node_modules\jquery\package.json (relative path: ./dist)
Field 'browser' doesn't contain a valid alias configuration
resolve as module
C:\Users\lenovo\miniconda3\share\jupyter\lab\staging\node_modules\jquery\dist\node_modules doesn't exist or is not a directory
C:\Users\lenovo\miniconda3\share\jupyter\lab\staging\node_modules\jquery\node_modules doesn't exist or is not a directory
C:\Users\lenovo\miniconda3\share\jupyter\lab\staging\node_modules\node_modules doesn't exist or is not a directory
looking for modules in C:\Users\lenovo\miniconda3\share\jupyter\lab\staging\node_modules
single file module
using description file: C:\Users\lenovo\miniconda3\share\jupyter\lab\staging\package.json (relative path: ./node_modules/jquery.js)
no extension
Field 'browser' doesn't contain a valid alias configuration
C:\Users\lenovo\miniconda3\share\jupyter\lab\staging\node_modules\jquery.js doesn't exist
.js
Field 'browser' doesn't contain a valid alias configuration
C:\Users\lenovo\miniconda3\share\jupyter\lab\staging\node_modules\jquery.js.js doesn't exist
.json
Field 'browser' doesn't contain a valid alias configuration
C:\Users\lenovo\miniconda3\share\jupyter\lab\staging\node_modules\jquery.js.json doesn't exist
.wasm
Field 'browser' doesn't contain a valid alias configuration
C:\Users\lenovo\miniconda3\share\jupyter\lab\staging\node_modules\jquery.js.wasm doesn't exist
C:\Users\lenovo\miniconda3\share\jupyter\lab\staging\node_modules\jquery.js doesn't exist
C:\Users\lenovo\miniconda3\share\jupyter\lab\node_modules doesn't exist or is not a directory
C:\Users\lenovo\miniconda3\share\jupyter\node_modules doesn't exist or is not a directory
C:\Users\lenovo\miniconda3\share\node_modules doesn't exist or is not a directory
looking for modules in C:\Users\lenovo\miniconda3\node_modules
single file module
using description file: C:\Users\lenovo\package.json (relative path: ./miniconda3/node_modules/jquery.js)
no extension
Field 'browser' doesn't contain a valid alias configuration
C:\Users\lenovo\miniconda3\node_modules\jquery.js doesn't exist
.js
Field 'browser' doesn't contain a valid alias configuration
C:\Users\lenovo\miniconda3\node_modules\jquery.js.js doesn't exist
.json
Field 'browser' doesn't contain a valid alias configuration
C:\Users\lenovo\miniconda3\node_modules\jquery.js.json doesn't exist
.wasm
Field 'browser' doesn't contain a valid alias configuration
C:\Users\lenovo\miniconda3\node_modules\jquery.js.wasm doesn't exist
C:\Users\lenovo\miniconda3\node_modules\jquery.js doesn't exist
looking for modules in C:\Users\lenovo\node_modules
single file module
using description file: C:\Users\lenovo\package.json (relative path: ./node_modules/jquery.js)
no extension
Field 'browser' doesn't contain a valid alias configuration
C:\Users\lenovo\node_modules\jquery.js doesn't exist
.js
Field 'browser' doesn't contain a valid alias configuration
C:\Users\lenovo\node_modules\jquery.js.js doesn't exist
.json
Field 'browser' doesn't contain a valid alias configuration
C:\Users\lenovo\node_modules\jquery.js.json doesn't exist
.wasm
Field 'browser' doesn't contain a valid alias configuration
C:\Users\lenovo\node_modules\jquery.js.wasm doesn't exist
C:\Users\lenovo\node_modules\jquery.js doesn't exist
C:\Users\node_modules doesn't exist or is not a directory
C:\node_modules doesn't exist or is not a directory�[39m
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
[LabBuildApp] Traceback (most recent call last):

[LabBuildApp] File "C:\Users\lenovo\miniconda3\lib\site-packages\jupyterlab\debuglog.py", line 47, in debug_logging
yield

[LabBuildApp] File "C:\Users\lenovo\miniconda3\lib\site-packages\jupyterlab\labapp.py", line 166, in start
raise e

[LabBuildApp] File "C:\Users\lenovo\miniconda3\lib\site-packages\jupyterlab\labapp.py", line 162, in start
build(name=self.name, version=self.version,

[LabBuildApp] File "C:\Users\lenovo\miniconda3\lib\site-packages\jupyterlab\commands.py", line 469, in build
return handler.build(name=name, version=version, static_url=static_url,

[LabBuildApp] File "C:\Users\lenovo\miniconda3\lib\site-packages\jupyterlab\commands.py", line 678, in build
raise RuntimeError(msg)

[LabBuildApp] RuntimeError: JupyterLab failed to build

[LabBuildApp] Exiting application: JupyterLab

@blink1073
Copy link
Member

@allenhutao please try upgrading JupyterLab to at least 3.0.7 to pick up the fix.

@allenhutao
Copy link

@allenhutao please try upgrading JupyterLab to at least 3.0.7 to pick up the fix.

i upgrade jupyterlab to 3.0.9,but it is still

@allenhutao
Copy link

This looks like a relevant part of the pip codebase for dealing with case sensitive files on Windows and making the entry point scripts: https://github.com/pypa/pip/blob/adca454611c2312e869956aeb51016947c134b60/src/pip/_vendor/distlib/scripts.py#L179-L186

Summarizing workarounds until JupyterLab 3.0.7 is published soon. Do one of the following:

  1. Run the build with python -m jupyterlab.labapp build
  2. Run the build within the application staging directory (i.e., the application directory from jupyter lab path, inside the staging directory
  3. Use conda instead of pip
  4. Use a different operating system than Windows

hi,i tried above,but it still
maybe i need uninstall jupyter and install it again.

@jasongrout
Copy link
Contributor

3.0.7 is now published with the workaround, so it or a later JupyterLab should not show this bug.

@gonzalezhomar
Copy link

Seeing the comments, I have the same issues, but I don't seem to understand which close up solution. I'm working on jupyter 3.0.16 but I cannot even update jupyter lab and it doesn't even start properly.

@dsaad68
Copy link

dsaad68 commented Aug 11, 2021

I have the same problem on JupyterLab 3.1.4.

@jasongrout
Copy link
Contributor

@gonzalezhomar @dsaad68 - this particular issue was fixed in JupyterLab 3.0.7. You may also have a build failure, but from a different underlying issue. Can you open a new issue with a report of what is failing for you? I suggest using the reporting guidelines to try to narrow down the problem first before opening an issue.

@gonzalezhomar
Copy link

@gonzalezhomar @dsaad68 - this particular issue was fixed in JupyterLab 3.0.7. You may also have a build failure, but from a different underlying issue. Can you open a new issue with a report of what is failing for you? I suggest using the reporting guidelines to try to narrow down the problem first before opening an issue.

Hey! Since I didn't understand the issue, I solved it by completely uninstalling anaconda distribution and reinstalling it. I believe it was a pip package and it's requirements the things that generate a different issue.

@github-actions github-actions bot added the status:resolved-locked Closed issues are locked after 30 days inactivity. Please open a new issue for related discussion. label Mar 6, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 6, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status:resolved-locked Closed issues are locked after 30 days inactivity. Please open a new issue for related discussion.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

10 participants