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

TypeError: call.getFileName is not a function #1

Open
5 tasks done
machitgarha opened this issue Feb 23, 2023 · 12 comments
Open
5 tasks done

TypeError: call.getFileName is not a function #1

machitgarha opened this issue Feb 23, 2023 · 12 comments
Labels
bug Something isn't working

Comments

@machitgarha
Copy link

machitgarha commented Feb 23, 2023

Thanks in advance for your bug report!

  • Have you reproduced issue in safe mode?
  • Have you used the debugging guide to try to resolve the issue?
  • Have you checked our FAQs to make sure your question isn't answered there?
  • Have you checked to make sure your issue does not already exist?
  • Have you checked you are on the latest release of Pulsar?

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 machitgarha added the bug Something isn't working label Feb 23, 2023
@machitgarha
Copy link
Author

machitgarha commented Feb 23, 2023

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
Copy link
Member

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
Copy link

tom-power commented Apr 1, 2023

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
Copy link

Same for me.

@gabrielalexandrelopes
Copy link

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:

  • Pulsar: 1.104.2023042015
  • MacOS Ventura 13.2.1 (22D68)

@mjrodgers
Copy link

mjrodgers commented May 27, 2023

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
Copy link

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
Copy link

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
Copy link

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
Copy link

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
Copy link

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
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

8 participants