# Jupyter lab build hangs and then fails at webpack --config webpack.prod.minimize.config.js

**URL:** <https://discourse.jupyter.org/t/jupyter-lab-build-hangs-and-then-fails-at-webpack-config-webpack-prod-minimize-config-js/6017>\
**Category:** JupyterLab\
**Created:** [September 17, 2020, 3:32pm UTC](https://discourse.jupyter.org/t/jupyter-lab-build-hangs-and-then-fails-at-webpack-config-webpack-prod-minimize-config-js/6017 "2020-09-17T15:32:21Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![thomas](https://avatars.discourse-cdn.com/v4/letter/t/e36b37/32.png) [@thomas](https://discourse.jupyter.org/u/thomas)\
**Post date:** [September 17, 2020, 3:32pm UTC](https://discourse.jupyter.org/t/jupyter-lab-build-hangs-and-then-fails-at-webpack-config-webpack-prod-minimize-config-js/6017/1 "2020-09-17T15:32:21Z")

</div>

I am trying to install git extension (jupyterlab/git) for my EC2 (t2.micro) JupyterLab . In the process when I run jupyter lab build it hangs for a long time and eventually fails .

Versions :

[root@ip-10-0-0-86 Jupyter]# jupyter-lab --version  
2.2.8  
[root@ip-10-0-0-86 Jupyter]# node --version  
v14.11.0

Error in log :

> ```
> $ ensure-max-old-space webpack --config webpack.prod.minimize.config.js
> child_process.js:637
> throw err;
> ^
> 
> Error: Command failed: /root/anaconda3/share/jupyter/lab/staging/node_modules/.bin/webpack --config webpack.prod.minimize.config.js
> 
> ```

**Entire log :**  
Building jupyterlab assets (build:prod:minimize)  
An error occured.  
RuntimeError: JupyterLab failed to build  
See the log file for details: /tmp/jupyterlab-debug-ea1w2u3r.log

[LabBuildApp] Node v14.11.0

[LabBuildApp] Yarn configuration loaded.  
[LabBuildApp] Building jupyterlab assets (build:prod:minimize)  
[LabBuildApp] \> node /root/anaconda3/lib/python3.6/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 1.14s.

[LabBuildApp] \> node /root/anaconda3/lib/python3.6/site-packages/jupyterlab/staging/yarn.js run build:prod:minimize  
[LabBuildApp] yarn run v1.21.1  
$ ensure-max-old-space webpack --config webpack.prod.minimize.config.js  
child\_process.js:637  
throw err;  
^

Error: Command failed: /root/anaconda3/share/jupyter/lab/staging/node\_modules/.bin/webpack --config webpack.prod.minimize.config.js  
at checkExecSyncError (child\_process.js:616:11)  
at Object.execFileSync (child\_process.js:634:15)  
at Object. (/root/anaconda3/share/jupyter/lab/staging/node\_modules/@jupyterlab/buildutils/lib/ensure-max-old-space.js:38:17)  
at Module.\_compile (internal/modules/cjs/loader.js:1076:30)  
at Object.Module.\_extensions…js (internal/modules/cjs/loader.js:1097:10)  
at Module.load (internal/modules/cjs/loader.js:941:32)  
at Function.Module.\_load (internal/modules/cjs/loader.js:782:14)  
at Function.executeUserEntryPoint [as runMain] (internal/modules/run\_main.js:72:12)  
at internal/main/run\_main\_module.js:17:47 {  
status: null,  
signal: ‘SIGKILL’,  
output: [null, null, null],  
pid: 25531,  
stdout: null,  
stderr: null  
}  
error Command failed with exit code 1.  
info Visit [yarn run | Yarn](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 “/root/anaconda3/lib/python3.6/site-packages/jupyterlab/debuglog.py”, line 47, in debug\_logging  
yield

I tried setting export NODE\_OPTIONS=“–max-old-space-size=2048” , --dev-build=False --minimize=True etc as suggested in some other threads . But nothing seem to help. Any pointers would be really helpful.

Thanks  
Thomas

---

<div class="post-metadata">

**Author:** ![markperri](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/markperri/32/2187_2.png) [@markperri](https://discourse.jupyter.org/u/markperri)\
**Post date:** [September 17, 2020, 9:36pm UTC](https://discourse.jupyter.org/t/jupyter-lab-build-hangs-and-then-fails-at-webpack-config-webpack-prod-minimize-config-js/6017/2 "2020-09-17T21:36:34Z")

</div>

I’ve run out of memory before building Jupyter Lab. I had to use a larger server to build it.

---

<div class="post-metadata">

**Author:** ![jasongrout](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/jasongrout/32/371_2.png) [@jasongrout](https://discourse.jupyter.org/u/jasongrout)\
**Post date:** [September 17, 2020, 9:47pm UTC](https://discourse.jupyter.org/t/jupyter-lab-build-hangs-and-then-fails-at-webpack-config-webpack-prod-minimize-config-js/6017/3 "2020-09-17T21:47:51Z")

</div>

Minimization takes a lot of memory. You could try with `--minimize False` to see if it helps.

---

<div class="post-metadata">

**Author:** ![thomas](https://avatars.discourse-cdn.com/v4/letter/t/e36b37/32.png) [@thomas](https://discourse.jupyter.org/u/thomas)\
**Post date:** [September 18, 2020, 4:46am UTC](https://discourse.jupyter.org/t/jupyter-lab-build-hangs-and-then-fails-at-webpack-config-webpack-prod-minimize-config-js/6017/4 "2020-09-18T04:46:55Z")

</div>

I had tried minimize False also but still fails. Is it possible to build certain extensions alone.

I have the following extensions installed -  
[root@ip-10-0-0-86 ec2-user]# jupyter labextension list  
JupyterLab v2.2.8  
Known labextensions:  
app dir: /root/anaconda3/share/jupyter/lab  
@jupyterlab/git v0.21.1 enabled OK  
nbdime-jupyterlab v2.0.0 enabled OK

Build recommended, please run `jupyter lab build`:  
nbdime-jupyterlab needs to be included in build  
@jupyterlab/git needs to be included in build

So can I build only those nbdime-jupyterlab and jupyterlab/git?

---

<div class="post-metadata">

**Author:** ![thomas](https://avatars.discourse-cdn.com/v4/letter/t/e36b37/32.png) [@thomas](https://discourse.jupyter.org/u/thomas)\
**Post date:** [September 20, 2020, 11:02am UTC](https://discourse.jupyter.org/t/jupyter-lab-build-hangs-and-then-fails-at-webpack-config-webpack-prod-minimize-config-js/6017/5 "2020-09-20T11:02:04Z")

</div>

Running with --minimize=False (I freed up as much memory as I could on my AWS EC2 t2.mico), there is no hang now but after a while build fails with same error .

```
[root@ip-10-0-0-86 Jupyter]# jupyter lab build --minimize=False
[LabBuildApp] JupyterLab 2.2.8
[LabBuildApp] Building in /root/anaconda3/share/jupyter/lab
[LabBuildApp] Building jupyterlab assets (build:prod)
Build failed.

```

In the log the only failures I see are :

[LabBuildApp] \> node /root/anaconda3/lib/python3.6/site-packages/jupyterlab/staging/yarn.js yarn-deduplicate -s fewer --fail [LabBuildApp] yarn run v1.21.1  
**$ /root/anaconda3/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](https://yarnpkg.com/en/docs/cli/run) for documentation about this command.  
:  
:

[LabBuildApp] \> node /root/anaconda3/lib/python3.6/site-packages/jupyterlab/staging/yarn.js run build:prod  
[LabBuildApp] yarn run v1.21.1  
$ ensure-max-old-space webpack --config webpack.prod.config.js  
child\_process.js:637  
throw err;  
^

**Error: Command failed: /root/anaconda3/share/jupyter/lab/staging/node\_modules/.bin/webpack --config webpack.prod.config.js**  
\*\* at checkExecSyncError (child\_process.js:616:11)\*\*  
\*\* at Object.execFileSync (child\_process.js:634:15)\*\*  
\*\* at Object. (/root/anaconda3/share/jupyter/lab/staging/node\_modules/@jupyterlab/buildutils/lib/ensure-max-old-space.js:38:17)\*\*  
\*\* at Module.\_compile (internal/modules/cjs/loader.js:1076:30)\*\*  
\*\* at Object.Module.\_extensions…js (internal/modules/cjs/loader.js:1097:10)\*\*  
\*\* at Module.load (internal/modules/cjs/loader.js:941:32)\*\*  
\*\* at Function.Module.\_load (internal/modules/cjs/loader.js:782:14)\*\*  
\*\* at Function.executeUserEntryPoint [as runMain] (internal/modules/run\_main.js:72:12)\*\*  
\*\* at internal/main/run\_main\_module.js:17:47 {\*\*  
\*\* status: null,\*\*  
\*\* signal: ‘SIGKILL’,\*\*  
\*\* output: [null, null, null],\*\*  
\*\* pid: 12135,\*\*  
\*\* stdout: null,\*\*  
\*\* stderr: null\*\*  
**}**

```
[root@ip-10-0-0-86 Jupyter]# **free -mh**
              total used free shared buff/cache available
Mem: 983M 64M 834M 408K 84M 807M
Swap: 0B 0B 0B

```

[root@ip-10-0-0-86 Jupyter]# echo $NODE\_OPTIONS  
–max-old-space-size=4096

I am only installing @jupyterlab-git extension not multiple extensions.

Any pointers would be helpful.

regards,  
Thomas

---

<div class="post-metadata">

**Author:** ![markperri](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/markperri/32/2187_2.png) [@markperri](https://discourse.jupyter.org/u/markperri)\
**Post date:** [September 21, 2020, 1:22am UTC](https://discourse.jupyter.org/t/jupyter-lab-build-hangs-and-then-fails-at-webpack-config-webpack-prod-minimize-config-js/6017/6 "2020-09-21T01:22:29Z")

</div>

You could try adding swap if it’s still running OOM. But I’d recommend running on a larger server.

---

<div class="post-metadata">

**Author:** ![thomas](https://avatars.discourse-cdn.com/v4/letter/t/e36b37/32.png) [@thomas](https://discourse.jupyter.org/u/thomas)\
**Post date:** [September 21, 2020, 8:40am UTC](https://discourse.jupyter.org/t/jupyter-lab-build-hangs-and-then-fails-at-webpack-config-webpack-prod-minimize-config-js/6017/7 "2020-09-21T08:40:15Z")

</div>

Thank you for the responses. As it is not feasible right now for me to move to a bigger server, I want to remove the extensions that started it all (and use the terminal for Git ). But when I try to uninstall the extension it finally re-builds and goes into the same loop erroring out .

```
[root@ip-10-0-0-86 /]# jupyter labextension uninstall --all
Uninstalling nbdime-jupyterlab from /root/anaconda3/share/jupyter/lab/extensions
Uninstalling @jupyterlab/git from /root/anaconda3/share/jupyter/lab/extensions
Building jupyterlab assets (build:prod:minimize)
An error occured.
RuntimeError: JupyterLab failed to build
See the log file for details: /tmp/jupyterlab-debug-r_zld6j5.log

And the log shows the same error on 
$ ensure-max-old-space webpack --config webpack.prod.config.js
child_process.js:637
throw err;

```

For getting the git extension I installed npm, nodejs and the git extension.

Now how can I go remove the lab extension (and webpack) from the build. I want to go back to my working jupyterlab install (without extension) ? Do I have to re-install jupyterlab? If so can someone give the clean way to un-install /re-install.

Thanks  
Thomas

---

<div class="post-metadata">

**Author:** ![lysakowski](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/lysakowski/32/984_2.png) [@lysakowski](https://discourse.jupyter.org/u/lysakowski)\
**Post date:** [October 16, 2020, 11:48pm UTC](https://discourse.jupyter.org/t/jupyter-lab-build-hangs-and-then-fails-at-webpack-config-webpack-prod-minimize-config-js/6017/8 "2020-10-16T23:48:22Z")

</div>

Thanks. This worked nicely for me.

> jupyter labextension install @jupyter-widgets/jupyterlab-manager --minimize=False

Rich

---

<div class="post-metadata">

**Author:** ![jasongrout](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/jasongrout/32/371_2.png) [@jasongrout](https://discourse.jupyter.org/u/jasongrout)\
**Post date:** [October 17, 2020, 3:42am UTC](https://discourse.jupyter.org/t/jupyter-lab-build-hangs-and-then-fails-at-webpack-config-webpack-prod-minimize-config-js/6017/9 "2020-10-17T03:42:15Z")

</div>

> [@thomas](#):
>
> `jupyter labextension uninstall --all`

You can use the `--no-build` switch to do install or uninstall operations without a rebuild, then rebuild at the end of your operations.
