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

[webpack-cli] ModuleNotFoundError: Module not found: Error: Can't resolve 'perf_hooks' #13582

Closed
erkin98 opened this issue Dec 13, 2022 · 3 comments
Labels
bug status:Needs Info status:Needs Triage Applied to new issues that need triage

Comments

@erkin98
Copy link
Contributor

erkin98 commented Dec 13, 2022

Description

[webpack-cli] ModuleNotFoundError: Module not found: Error: Can't resolve 'perf_hooks' in '/home/erkin/builds/jupyter-app-dir/staging/node_modules/typescript/lib'

Reproduce

  1. Go to local extension folder
  2. Link extension jupyter labextension link . --no-build
  3. Run jupyter lab build
  4. See error 'Error: Can't resolve 'perf_hooks''

Expected behavior

It should build successfully

Context

  • Operating System and version: Linux Ubuntu 22.04
  • Browser and version: Chrome 92
  • JupyterLab version: 3.5.1
Troubleshoot Output
Paste the output from running `jupyter troubleshoot` from the command line here.
You may want to sanitize the paths in the output.
Command Line Output

[webpack-cli] ModuleNotFoundError: Module not found: Error: Can't resolve 'perf_hooks' in '/home/erkin/builds/jupyter-app-dir/staging/node_modules/typescript/lib'
at /home/erkin/builds/jupyter-app-dir/staging/node_modules/webpack/lib/Compilation.js:1768:28
at /home/erkin/builds/jupyter-app-dir/staging/node_modules/webpack/lib/NormalModuleFactory.js:742:13
at eval (eval at create (/home/erkin/builds/jupyter-app-dir/staging/node_modules/tapable/lib/HookCodeFactory.js:33:10), :10:1)
at /home/erkin/builds/jupyter-app-dir/staging/node_modules/webpack/lib/NormalModuleFactory.js:276:22
at eval (eval at create (/home/erkin/builds/jupyter-app-dir/staging/node_modules/tapable/lib/HookCodeFactory.js:33:10), :9:1)
at /home/erkin/builds/jupyter-app-dir/staging/node_modules/webpack/lib/NormalModuleFactory.js:405:22
at /home/erkin/builds/jupyter-app-dir/staging/node_modules/webpack/lib/NormalModuleFactory.js:119:11
at /home/erkin/builds/jupyter-app-dir/staging/node_modules/webpack/lib/NormalModuleFactory.js:650:24
at /home/erkin/builds/jupyter-app-dir/staging/node_modules/webpack/lib/NormalModuleFactory.js:813:8
at /home/erkin/builds/jupyter-app-dir/staging/node_modules/webpack/lib/NormalModuleFactory.js:933:5
resolve 'perf_hooks' in '/home/erkin/builds/jupyter-app-dir/staging/node_modules/typescript/lib'
Parsed request is a module
using description file: /home/erkin/builds/jupyter-app-dir/staging/node_modules/typescript/package.json (relative path: ./lib)
resolve as module
/home/erkin/builds/jupyter-app-dir/staging/node_modules/typescript/lib/node_modules doesn't exist or is not a directory
/home/erkin/builds/jupyter-app-dir/staging/node_modules/typescript/node_modules doesn't exist or is not a directory
/home/erkin/builds/jupyter-app-dir/staging/node_modules/node_modules doesn't exist or is not a directory
looking for modules in /home/erkin/builds/jupyter-app-dir/staging/node_modules
single file module
using description file: /home/erkin/builds/jupyter-app-dir/staging/package.json (relative path: ./node_modules/perf_hooks)
no extension
Field 'browser' doesn't contain a valid alias configuration
/home/erkin/builds/jupyter-app-dir/staging/node_modules/perf_hooks doesn't exist
.js
Field 'browser' doesn't contain a valid alias configuration
/home/erkin/builds/jupyter-app-dir/staging/node_modules/perf_hooks.js doesn't exist
.json
Field 'browser' doesn't contain a valid alias configuration
/home/erkin/builds/jupyter-app-dir/staging/node_modules/perf_hooks.json doesn't exist
.wasm
Field 'browser' doesn't contain a valid alias configuration
/home/erkin/builds/jupyter-app-dir/staging/node_modules/perf_hooks.wasm doesn't exist
/home/erkin/builds/jupyter-app-dir/staging/node_modules/perf_hooks doesn't exist
/home/erkin/builds/jupyter-app-dir/node_modules doesn't exist or is not a directory
/home/erkin/builds/node_modules doesn't exist or is not a directory
/home/erkin/node_modules doesn't exist or is not a directory
/home/erkin/node_modules doesn't exist or is not a directory
/home/node_modules doesn't exist or is not a directory
/node_modules doesn't exist or is not a directory
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 "/home/erkin/miniconda3/envs/rova_dev/lib/python3.10/site-packages/jupyterlab/debuglog.py", line 47, in debug_logging
yield

[LabBuildApp] File "/home/erkin/miniconda3/envs/rova_dev/lib/python3.10/site-packages/jupyterlab/labapp.py", line 196, in start
raise e

[LabBuildApp] File "/home/erkin/miniconda3/envs/rova_dev/lib/python3.10/site-packages/jupyterlab/labapp.py", line 187, in start
build(

[LabBuildApp] File "/home/erkin/miniconda3/envs/rova_dev/lib/python3.10/site-packages/jupyterlab/commands.py", line 506, in build
return handler.build(

[LabBuildApp] File "/home/erkin/miniconda3/envs/rova_dev/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

</pre>
</details>

<details><summary>Browser Output</summary>
<!--See https://webmasters.stackexchange.com/a/77337 for how to access the JavaScript console-->
<pre>
Paste the output from your browser Javascript console here, if applicable.

</pre>
</details>
@erkin98 erkin98 added the bug label Dec 13, 2022
@jupyterlab-probot jupyterlab-probot bot added the status:Needs Triage Applied to new issues that need triage label Dec 13, 2022
@JasonWeill
Copy link
Contributor

Have you run jlpm install? Any errors when you do so?

Does this same error happen when you have a blank extension, such as one created from the cookiecutter without modification?

Are you using Conda, Mamba, or some other way to install and run JupyterLab? If you're using Conda/Mamba, are you using the same environment in all your terminals?

@JasonWeill
Copy link
Contributor

When you can, please provide the info requested above so that we can help triage this issue. Thanks!

@erkin98
Copy link
Contributor Author

erkin98 commented Dec 29, 2022 via email

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 30, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug status:Needs Info status:Needs Triage Applied to new issues that need triage
Projects
None yet
Development

No branches or pull requests

2 participants