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

Error: Cannot find module bridge.js #89

Open
Romhast opened this issue Jul 26, 2023 · 3 comments
Open

Error: Cannot find module bridge.js #89

Romhast opened this issue Jul 26, 2023 · 3 comments
Labels
enhancement New feature or request waiting for info waiting for for info from poster

Comments

@Romhast
Copy link

Romhast commented Jul 26, 2023

I can use it comfortably without converting it to exe, but I convert it to exe using pyinstaller, then when I want to start the program, it gives me the following error output. Do I need to show a location while using pyinstaller? I will be glad if you help me.

[JSE] node:internal/modules/cjs/loader:1080
[JSE]   throw err;
[JSE]   ^
[JSE]
[JSE] Error: Cannot find module 'C:\Users\fatih\AppData\Local\Temp\_MEI195202\javascript\js\bridge.js'
[JSE]     at Module._resolveFilename (node:internal/modules/cjs/loader:1077:15)
[JSE]     at Module._load (node:internal/modules/cjs/loader:922:27)
[JSE]     at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
[JSE]     at node:internal/main/run_main_module:23:47 {
[JSE]   code: 'MODULE_NOT_FOUND',
[JSE]   requireStack: []
[JSE] }
[JSE]
[JSE] Node.js v18.17.0

** The Node process has crashed. Please restart the runtime to use JS APIs. **

Timed out get 0 needsNodePatches None
Traceback (most recent call last):
  File "sab.py", line 11, in <module>
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "PyInstaller\loader\pyimod02_importers.py", line 385, in exec_module
  File "javascript\__init__.py", line 20, in <module>
  File "javascript\__init__.py", line 16, in init
  File "javascript\proxy.py", line 225, in __getattr__
  File "javascript\proxy.py", line 145, in getProp
  File "javascript\proxy.py", line 38, in ipc
Exception: Timed out accessing 'needsNodePatches'
[9164] Failed to execute script 'sab' due to unhandled exception!
@extremeheat
Copy link
Owner

This is an issue with PyInstaller. Because JSPyBridge requires a Node.js runtime to work (in addition to Python), you would need to have special logic to embed a Node.js runtime into your program and have it work nicely with the existing code (and have it work). I think this seems outside the scope of what JSPyBridge intends to provide as a helpful developer tool rather than something for end users.

Would you like to explain the need for pyinstaller/have any comment on why it's important to support ?

@extremeheat extremeheat added enhancement New feature or request waiting for info waiting for for info from poster labels Mar 4, 2024
@antont
Copy link

antont commented Mar 4, 2024

I believe you can configure pyinstaller to include additional files which it does not discover automatically, https://www.pyinstaller.org/en/stable/spec-files.html

@naveenprabhuk
Copy link

Hi @Romhast

Have you fixed this error in JSPyBridge using python. I also have same error occuring in Django Restframework with the IIS server after deploy. In local deployment its working perfectly but in IIS server not working its shows timeout accessing need Nodepatches after sometimes its returning timeout accessing console.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request waiting for info waiting for for info from poster
Projects
None yet
Development

No branches or pull requests

4 participants