pulsar-edit / ide-python

Python language support for Pulsar :atom: :snake:
Other
0 stars 0 forks source link

TypeError: `call.getFileName` is not a function #1

Open machitgarha opened 1 year ago

machitgarha commented 1 year ago

Thanks in advance for your bug report!

What happened?

When activating the package, the error shows up, as reported multiple times upstream:

TypeError: call.getFileName is not a function
    at getErrMessage (assert.js:278:25)
    at innerOk (assert.js:372:17)
    at ok (assert.js:392:3)
    at /packages/ide-python/node_modules/@atom-ide-community/nuclide-commons-ui/Dropdown.js:45:21)
    at /packages/ide-python/node_modules/@atom-ide-community/nuclide-commons-ui/Dropdown.js:305:3)
    at Module.get_Module._compile (/Applications/Atom 2.app/Contents/Resources/app/static/<embedded>:11:149913)
    at Object.value [as .js] (/Applications/Atom 2.app/Contents/Resources/app/static/<embedded>:11:153507)
    at Module.load (internal/modules/cjs/loader.js:992:32)
    at Module._load (internal/modules/cjs/loader.js:885:14)
    at Function.f._load (electron/js2c/asar_bundle.js:5:12633)
    at Module.require (/app.asar/static/index.js:72:46)
    at require (/Applications/Atom 2.app/Contents/Resources/app/static/<embedded>:11:149229)
    at /packages/ide-python/node_modules/@atom-ide-community/nuclide-debugger-common/AutoGenLaunchAttachUiComponent.js:16:17)
    at /packages/ide-python/node_modules/@atom-ide-community/nuclide-debugger-common/AutoGenLaunchAttachUiComponent.js:519:3)
    at Module.get_Module._compile (/Applications/Atom 2.app/Contents/Resources/app/static/<embedded>:11:149913)
    at Object.value [as .js] (/Applications/Atom 2.app/Contents/Resources/app/static/<embedded>:11:153507)
    at Module.load (internal/modules/cjs/loader.js:992:32)
    at Module._load (internal/modules/cjs/loader.js:885:14)
    at Function.f._load (electron/js2c/asar_bundle.js:5:12633)
    at Module.require (/app.asar/static/index.js:72:46)
    at require (/Applications/Atom 2.app/Contents/Resources/app/static/<embedded>:11:149229)
    at /packages/ide-python/node_modules/@atom-ide-community/nuclide-debugger-common/AutoGenLaunchAttachProvider.js:14:62)
    at /packages/ide-python/node_modules/@atom-ide-community/nuclide-debugger-common/AutoGenLaunchAttachProvider.js:109:3)
    at Module.get_Module._compile (/Applications/Atom 2.app/Contents/Resources/app/static/<embedded>:11:149913)
    at Object.value [as .js] (/Applications/Atom 2.app/Contents/Resources/app/static/<embedded>:11:153507)
    at Module.load (internal/modules/cjs/loader.js:992:32)
    at Module._load (internal/modules/cjs/loader.js:885:14)
    at Function.f._load (electron/js2c/asar_bundle.js:5:12633)
    at Module.require (/app.asar/static/index.js:72:46)
    at require (/Applications/Atom 2.app/Contents/Resources/app/static/<embedded>:11:149229)

Pulsar version

1.102.0

Which OS does this happen on?

🐧 Red Hat based (Fedora, Alma, RockyLinux, CentOS Stream, etc.)

OS details

Fedora 37 WS

Which CPU architecture are you running this on?

64-bit(x86_64)

What steps are needed to reproduce this?

  1. Install and enable ide-python package.
  2. Open or reload the editor (and probably open a Python file).

Additional Information:

No response

machitgarha commented 1 year ago

The problem is, a new version of atom-ide-base dependency has not been released for around two years, although the source code is more recent.

The actual problem is at line 45 of Dropdown.js, which got replaced in the more recent codebase.

Is there a plan to add NPM packages for Pulsar?

confused-Techie commented 1 year ago

Thanks a ton for the contribution in reporting this error.

The collection of packages forked more directly from atom-community haven't received a lot of attention recently. But we appreciate you letting us know about the error.

Otherwise while this sort of thing hasn't come up a lot in discussion, I'm not confident in thinking we will publish much to things like NPM. We are working hard to keep the amount of stuff we have to maintain down, and that likely would include packages on NPM. But if there's a use case and/or a need it very well could happen.

tom-power commented 1 year ago

Hi, doing similar to this stops the error for me, not ideal but \o/

Tried using the more recent atom-ide-base, and the branch aminya was working on, didn't help so far but maybe doing something wrong, worth following up?

diff --git a/lib/main.js b/lib/main.js
index 4e004ac..8cb73d8 100644
--- a/lib/main.js
+++ b/lib/main.js
@@ -3,7 +3,7 @@ const whichSync = require("which").sync
 const { AutoLanguageClient } = require("atom-languageclient")
 const { detectVirtualEnv, detectPipEnv, replacePipEnvPathVar, sanitizeConfig } = require("./utils")

-import { createDebuggerProvider, activate as debuggerActivate, dispose as debuggerDispose } from "./debugger/main"
+// import { createDebuggerProvider, activate as debuggerActivate, dispose as debuggerDispose } from "./debugger/main"

 // Ref: https://github.com/nteract/hydrogen/blob/master/lib/autocomplete-provider.js#L33
 // adapted from http://stackoverflow.com/q/5474008
@@ -25,7 +25,7 @@ class PythonLanguageClient extends AutoLanguageClient {
     }
     // Remove deprecated option
     atom.config.unset("ide-python.pylsPath")
-    debuggerActivate()
+    // debuggerActivate()
   }

   /* eslint-disable class-methods-use-this */
@@ -139,7 +139,7 @@ class PythonLanguageClient extends AutoLanguageClient {
   }

   deactivate() {
-    debuggerDispose()
+    // debuggerDispose()
     return Promise.race([super.deactivate(), this.createTimeoutPromise(2000)])
   }

@@ -155,5 +155,5 @@ class PythonLanguageClient extends AutoLanguageClient {
 }

 const pythonClient = new PythonLanguageClient()
-pythonClient.createDebuggerProvider = createDebuggerProvider // add the debugger
+// pythonClient.createDebuggerProvider = createDebuggerProvider // add the debugger
 module.exports = pythonClient
Titousensei commented 1 year ago

Same for me.

gabrielalexandrelopes commented 1 year ago

I commented out line 45 in .pulsar/packages/ide-python/node_modules/@atom-ide-community/nuclide-commons-ui/Dropdown.js (//(0, _assert.default)(_electronRemote.default != null); // For backwards compat, we have to do some conversion here.) and the ide-python package seems to be working normally. Using:

mjrodgers commented 1 year ago

I've got a new fork of this, pulsar-ide-python, which basically removes all of the nuclide dependencies from the project. I did this by rolling back to version 1.5.4 (which was before the atom-community takeover) and then re-added all of the commits that were related to bug fixes and feature enhancements, the only thing that relied on these nuclide dependencies were the debugger support so that is now gone.

(side note: the atom-ide-debugger never made it past an "Experimental" state, and currently can't actually be activated in either Atom 1.60.0 or Pulsar anyway).

denys-zarubin commented 1 year ago

after installing pulsar-ide-python I got issue

No native build was found for platform=darwin arch=arm64 runtime=electron abi=87 uv=1 armv=8 libc=glibc node=14.16.0 electron=12.2.3 loaded from: <PATH>/ide-python/node_modules/zadeh

Macbook M1

mjrodgers commented 1 year ago

hmm, you might want to try navigating to the package directory and running npx electron-rebuild -v 12.2.3. I don't have access to an M1 Mac to test, but I see this is a known issue for the Zadeh dependency, they have an open (and recent) pull request to fix it but they haven't updated the package in a few years so we'll see if they push it through or now...

contang0 commented 1 year ago

hmm, you might want to try navigating to the package directory and running npx electron-rebuild -v 12.2.3. I don't have access to an M1 Mac to test, but I see this is a known issue for the Zadeh dependency, they have an open (and recent) pull request to fix it but they haven't updated the package in a few years so we'll see if they push it through or now...

I tried it, but for whatever reason linter doesn't show any results.

mjrodgers commented 1 year ago

I tried it, but for whatever reason linter doesn't show any results.

Is this the same issue, or a different issue? Are you getting the TypeError described, or does everything seem to work except the linter? (if so, please open a separate issue and include some details about your setup).

contang0 commented 1 year ago

Yes, I am also getting the TypeError described here. I tried to disable ide-python and only have pulsar-ide-python enabled. When I do, TypeError goes away, but then linter does not show any results. I just did some testing and oddly enough it only works when I have both ide-python and pulsar-ide-python enabled. I'll open a new issue in pulsar-ide-python.

denys-zarubin commented 1 year ago

hmm, you might want to try navigating to the package directory and running npx electron-rebuild -v 12.2.3. I don't have access to an M1 Mac to test, but I see this is a known issue for the Zadeh dependency, they have an open (and recent) pull request to fix it but they haven't updated the package in a few years so we'll see if they push it through or now...

traceback:

❯ npx electron-rebuild -v 12.2.3 ⠼ Building module: zadeh, Completed: 0gyp: name 'openssl_fips' is not defined while evaluating condition 'openssl_fips != ""' in binding.gyp while trying to load binding.gyp ✖ Rebuild Failed

An unhandled error occurred inside electron-rebuild node-gyp failed to rebuild '/Users/d/.pulsar/packages/pulsar-ide-python/node_modules/zadeh'. For more information, rerun with the DEBUG environment variable set to "electron-rebuild".

Error: gyp failed with exit code: 1

Error: node-gyp failed to rebuild '/Users/d/.pulsar/packages/pulsar-ide-python/node_modules/zadeh'. For more information, rerun with the DEBUG environment variable set to "electron-rebuild".

Error: gyp failed with exit code: 1

at NodeGyp.rebuildModule (/Users/d/.npm/_npx/c78fbb4f3949be78/node_modules/electron-rebuild/lib/src/module-type/node-gyp.js:120:19)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async ModuleRebuilder.rebuildNodeGypModule (/Users/d/.npm/_npx/c78fbb4f3949be78/node_modules/electron-rebuild/lib/src/module-rebuilder.js:98:9)
at async ModuleRebuilder.rebuild (/Users/d/.npm/_npx/c78fbb4f3949be78/node_modules/electron-rebuild/lib/src/module-rebuilder.js:128:14)
at async Rebuilder.rebuildModuleAt (/Users/d/.npm/_npx/c78fbb4f3949be78/node_modules/electron-rebuild/lib/src/rebuild.js:149:13)
at async Rebuilder.rebuild (/Users/d/.npm/_npx/c78fbb4f3949be78/node_modules/electron-rebuild/lib/src/rebuild.js:112:17)
at async /Users/d/.npm/_npx/c78fbb4f3949be78/node_modules/electron-rebuild/lib/src/cli.js:158:9