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 atharva21-stack opened this issue 4 years ago • 10 comments

[Enter steps to reproduce:]

  1. ...
  2. ...

Atom: 1.53.0 x64 Electron: 6.1.12 OS: macOS 11.1 Thrown From: gpp-compiler package 3.0.7

Stack Trace

Uncaught TypeError: Callback must be a function. Received undefined

At fs.js:142

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

Commands

  5x -1:20 core:backspace (input.hidden-input)
  2x -1:17.2.0 core:move-right (input.hidden-input)
 10x -1:14.9.0 core:backspace (input.hidden-input)
     -1:12.2.0 autocomplete-plus:confirm (input.hidden-input)
     -1:12.2.0 snippets:expand (atom-text-editor.editor.is-focused.autocomplete-active)
  6x -1:11.3.0 core:move-right (input.hidden-input)
     -1:04.5.0 core:backspace (input.hidden-input)
  3x -1:01.2.0 core:move-left (input.hidden-input)
  3x -0:59.4.0 core:move-right (input.hidden-input)
     -0:56 core:backspace (input.hidden-input)
  2x -0:55 core:move-right (input.hidden-input)
  5x -0:54.4.0 core:move-down (input.hidden-input)
  7x -0:45.4.0 editor:delete-to-beginning-of-line (input.hidden-input)
  9x -0:39.2.0 gpp-compiler:compile (input.hidden-input)
  4x -0:17.4.0 core:save (input.hidden-input)
  2x -0:16.4.0 gpp-compiler:compile (input.hidden-input)

Non-Core Packages

gpp-compiler 3.0.7 

atharva21-stack avatar Dec 20 '20 14:12 atharva21-stack

I have the same proble when i tried to run my c program what should i do?

MauricioFelixTan avatar Dec 21 '20 09:12 MauricioFelixTan

having the problem while compiling the C++ code on Atom ide. How to solve this??

ankittrajj avatar Dec 25 '20 18:12 ankittrajj

having the problem while compiling the C++ code on Atom ide. How to solve this??

if you do somehow find the solution then please post it here.

wasifshaffaq avatar Dec 26 '20 15:12 wasifshaffaq

i was on windows and updating mingw using cmd helped me out.

snull avatar Dec 26 '20 19:12 snull

Having the same issue too, it was working just fine yesterday

gotjon05 avatar Dec 26 '20 23:12 gotjon05

For me the format string is creating the error "Uncaught TypeError: Callback must be a function. Received undefined"

This fails: #include <stdio.h> int main(){ printf("%s", please work); }

And this works: int main(){ printf("please work"); }

gotjon05 avatar Dec 27 '20 03:12 gotjon05

having the problem while compiling the C++ code on Atom ide. How to solve this??

I found the solution- there is very silly mistake in my code i.e. I forgot to write semicolon and also mis-spell the cout (this solution is only for my error )if you have the same comment here.

ankittrajj avatar Dec 29 '20 09:12 ankittrajj

Guys, i just found out the solution for this problem. At least that is what i was doing wrong, i was not saving my file as .c or .cpp for c and c++ language that is required for gpp compiler to process.

VedanshSharma0412 avatar Dec 29 '20 17:12 VedanshSharma0412

try doing this, i think it could solve your issue. this worked in my device.

VedanshSharma0412 avatar Dec 29 '20 17:12 VedanshSharma0412

For me the format string is creating the error "Uncaught TypeError: Callback must be a function. Received undefined"

This fails: #include <stdio.h> int main(){ printf("%s", please work); }

And this works: int main(){ printf("please work"); }

/* you did not declare the string "please work", hence why your program will crush (%s is a place holder for a non declared string.). here is a sample that should work fine.*/

#include <stdio.h> #define SIZE 50 int main(void) { char string[SIZE] = "please work," ; printf("%s \n",string); }

Skepticisme avatar Dec 31 '20 16:12 Skepticisme