atom-gpp-compiler icon indicating copy to clipboard operation
atom-gpp-compiler copied to clipboard

Uncaught TypeError: Callback must be a function. Received undefined

Open Aayush786eng opened this issue 3 years ago • 6 comments

[Enter steps to reproduce:]

  1. ...
  2. ...

Atom: 1.57.0 x64 Electron: 9.4.4 OS: Ubuntu 20.04.2 Thrown From: gpp-compiler package 3.0.7

Stack Trace

Uncaught TypeError: Callback must be a function. Received undefined

At fs.js:135

TypeError [ERR_INVALID_CALLBACK] [ERR_INVALID_CALLBACK]: Callback must be a function. Received undefined
    at maybeCallback (fs.js:135:9)
    at Object.writeFile (fs.js:1234:14)
    at /packages/gpp-compiler/index.js:299:12)
    at ChildProcess.emit (events.js:223:5)
    at maybeClose (internal/child_process.js:1021:16)
    at Socket.<anonymous> (internal/child_process.js:430:11)
    at Socket.emit (events.js:223:5)
    at Pipe.<anonymous> (net.js:664:12)

Commands

     -1:55.5.0 autocomplete-plus:activate (input.hidden-input)
     -1:55.5.0 snippets:expand (atom-text-editor.editor.is-focused.autocomplete-active)
  2x -1:48 core:backspace (input.hidden-input)
  2x -1:30.9.0 core:move-right (input.hidden-input)
  2x -1:29.4.0 core:backspace (input.hidden-input)
  2x -1:27.2.0 core:move-right (input.hidden-input)
  2x -1:24.6.0 core:backspace (input.hidden-input)
     -1:12.6.0 core:move-right (input.hidden-input)
     -1:11.1.0 core:backspace (input.hidden-input)
  2x -1:09.9.0 core:move-right (input.hidden-input)
     -1:08.1.0 editor:newline (input.hidden-input)
     -0:47.1.0 core:move-right (input.hidden-input)
     -0:46 core:backspace (input.hidden-input)
 10x -0:44.7.0 core:move-down (input.hidden-input)
     -0:29.7.0 editor:newline (input.hidden-input)
     -0:21.7.0 gpp-compiler:compile (input.hidden-input)

Non-Core Packages

auto-c-header 0.1.0 
busy-signal 2.0.1 
gpp-compiler 3.0.7 
intentions 1.1.5 
jextious-syntax 0.5.0 
linter 3.3.1 
linter-gcc 0.9.0 
linter-ui-default 3.3.1 

Aayush786eng avatar Jun 13 '21 14:06 Aayush786eng

[Enter steps to reproduce:]

  1. ...
  2. ...

Atom: 1.57.0 x64 Electron: 9.4.4 OS: Unknown Windows version Thrown From: gpp-compiler package 3.0.7

Stack Trace

Uncaught TypeError: Callback must be a function. Received undefined

At fs.js:135

TypeError [ERR_INVALID_CALLBACK] [ERR_INVALID_CALLBACK]: Callback must be a function. Received undefined
    at maybeCallback (fs.js:135:9)
    at Object.writeFile (fs.js:1234:14)
    at /packages/gpp-compiler/index.js:299:12)
    at ChildProcess.emit (events.js:223:5)
    at maybeClose (internal/child_process.js:1021:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)

Commands

     -8:56.1.0 snippets:next-tab-stop (input.hidden-input)
     -8:56.1.0 snippets:expand (input.hidden-input)
     -8:56.1.0 editor:indent (input.hidden-input)
     -6:42.5.0 command-palette:toggle (a.btn-issue.btn.btn-error)
     -6:40.6.0 core:paste (input.hidden-input)
     -6:39.5.0 core:confirm (input.hidden-input)
 18x -6:26.2.0 core:select-up (input.hidden-input)
     -6:24.8.0 core:select-down (input.hidden-input)
 47x -6:24.1.0 core:select-left (input.hidden-input)
  2x -6:20.6.0 core:backspace (input.hidden-input)
 12x -6:19 core:select-down (input.hidden-input)
  2x -6:17 core:backspace (input.hidden-input)
 47x -6:14.3.0 core:move-left (input.hidden-input)
 12x -6:11.4.0 core:backspace (input.hidden-input)
 22x -6:09.5.0 core:move-right (input.hidden-input)
     -1:55.9.0 gpp-compiler:compile (input.hidden-input)

Non-Core Packages

gpp-compiler 3.0.7 
ide-c-cpp 0.1.0 

ABdullah1alsayed avatar Jul 27 '21 18:07 ABdullah1alsayed

My atom error sent me to this specific issue from the "View Issue" button.

Reproduction Happens on F5 press every time.

Note The project compiles perfectly fine with make and gpp straight from the command line in Linux (Ubuntu 20.04 LTS).

Stack Trace (This seems similar, but not exact so I'm sorry if this is the wrong place to post) Callback must be a function. Received undefined

fs.js:135 Uncaught TypeError [ERR_INVALID_CALLBACK] [ERR_INVALID_CALLBACK]: Callback must be a function. Received undefined
    at maybeCallback (fs.js:135)
    at Object.writeFile (fs.js:1234)
    at ChildProcess.<anonymous> (/home/flux/.atom/pac…mpiler/index.js:299)
    at ChildProcess.emit (events.js:223)
    at maybeClose (internal/child_process.js:1021)
    at Socket.<anonymous> (internal/child_process.js:430)
    at Socket.emit (events.js:223)
    at Pipe.<anonymous> (net.js:664)

This is no big deal for me as I was just checking out Atom plugins out of curiosity and just generally use the command line anyway, but I thought I'd add try and help out (of course, not sure that it will).

Lateralus138 avatar Jul 30 '21 03:07 Lateralus138

Hello !

I have stopped using atom for C++ dev because of this issue but maybe I get it wrong,

when I compile C++ code with an error, several thing happens that annoy me,

1 - the C++ errors appears in a red pop up on the right, for only a couple seconds, then this pop up disappear. 2 - I can't click any of the errors in the pop up to go directly to the error in the code 3 - There is a second pop up (and this one does not close by itself), that brought me to this issue "Uncaught TypeError ..."

So, is this addon suppose to popup the errors like that ? Or is it supposed to be something like the gcc-linter, that opens a palet on the bottom of the window, properly listing clickable errors ?

If this is a real bug (I guess it is) I'm willing to find it and fix it, although I'm no expert, so if somebody could point me in the right direction woul'd be greater thant great !

because VScode for C++ SUCKS (highlighting takes ages ....) and I'm tired of it !!! And QT well, works weel but is less .... sexy

anyhow . thanks !

ebkgne avatar Aug 03 '21 13:08 ebkgne

My atom error sent me to this specific issue from the "View Issue" button.

Reproduction Happens on F5 press every time.

Note The project compiles perfectly fine with make and gpp straight from the command line in Linux (Ubuntu 20.04 LTS).

Stack Trace (This seems similar, but not exact so I'm sorry if this is the wrong place to post) Callback must be a function. Received undefined

fs.js:135 Uncaught TypeError [ERR_INVALID_CALLBACK] [ERR_INVALID_CALLBACK]: Callback must be a function. Received undefined
    at maybeCallback (fs.js:135)
    at Object.writeFile (fs.js:1234)
    at ChildProcess.<anonymous> (/home/flux/.atom/pac…mpiler/index.js:299)
    at ChildProcess.emit (events.js:223)
    at maybeClose (internal/child_process.js:1021)
    at Socket.<anonymous> (internal/child_process.js:430)
    at Socket.emit (events.js:223)
    at Pipe.<anonymous> (net.js:664)

This is no big deal for me as I was just checking out Atom plugins out of curiosity and just generally use the command line anyway, but I thought I'd add try and help out (of course, not sure that it will).

i tried compiling the code in the developer tools(view>developer>toggle developer; and just press f5) and it worked for me

tiredEyes123 avatar Aug 07 '21 07:08 tiredEyes123

I just a similar issue with the plugin, with no prior knowledge to this, I would like this to be fixed ASAP please, as it is hindering some of my sources `[Enter steps to reproduce:]

  1. ...
  2. ...

Atom: 1.58.0 x64 Electron: 9.4.4 OS: Microsoft Windows 10 Home Thrown From: gpp-compiler package 3.0.7

Stack Trace

Uncaught TypeError: Callback must be a function. Received undefined

At fs.js:135

TypeError [ERR_INVALID_CALLBACK] [ERR_INVALID_CALLBACK]: Callback must be a function. Received undefined
    at maybeCallback (fs.js:135:9)
    at Object.writeFile (fs.js:1234:14)
    at /packages/gpp-compiler/index.js:299:12)
    at ChildProcess.emit (events.js:223:5)
    at maybeClose (internal/child_process.js:1021:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)

Commands

  2x -0:53 cpp-compiler:compile (input.hidden-input)
     -0:43.9.0 settings-view:open (input.hidden-input)
     -0:18.5.0 gpp-compiler:compile (input.hidden-input)

Non-Core Packages

cpp-compiler 1.3.0 
gpp-compiler 3.0.7 

`

Aayan-joshi avatar Aug 07 '21 13:08 Aayan-joshi

I experience it too, compiling it via command line works fine.

TAKfsg avatar Sep 02 '21 04:09 TAKfsg