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

Uncaught TypeError: The "file" argument must be of type string. Received type undefined

Open vinothsha opened this issue 3 years ago • 18 comments

[Enter steps to reproduce:]

  1. ...
  2. ...

Atom: 1.55.0 x64 Electron: 6.1.12 OS: Microsoft Windows 10 Home Single Language Thrown From: gpp-compiler package 3.0.7

Stack Trace

Uncaught TypeError: The "file" argument must be of type string. Received type undefined

At internal/validators.js:107

TypeError [ERR_INVALID_ARG_TYPE] [ERR_INVALID_ARG_TYPE]: The "file" argument must be of type string. Received type undefined
    at validateString (internal/validators.js:107:11)
    at normalizeSpawnArguments (child_process.js:406:3)
    at Object.spawn (child_process.js:542:16)
    at compile (/packages/gpp-compiler/index.js:274:31)
    at compileFile (/packages/gpp-compiler/index.js:216:5)
    at /packages/gpp-compiler/index.js:23:11)
    at CommandRegistry.handleCommandEvent (~/AppData/Local/atom/app-1.55.0/resources/app/static/<embedded>:11:350382)
    at KeymapManager.dispatchCommandEvent (~/AppData/Local/atom/app-1.55.0/resources/app/static/<embedded>:11:1230982)
    at KeymapManager.handleKeyboardEvent (~/AppData/Local/atom/app-1.55.0/resources/app/static/<embedded>:11:1227116)
    at WindowEventHandler.handleDocumentKeyEvent (~/AppData/Local/atom/app-1.55.0/resources/app/static/<embedded>:11:284879)

Commands

     -7:04.4.0 core:paste (input.hidden-input)
 15x -6:48.4.0 core:backspace (input.hidden-input)
     -6:46.6.0 editor:delete-to-beginning-of-word (input.hidden-input)
 14x -6:46.1.0 core:backspace (input.hidden-input)
     -6:45.1.0 core:paste (input.hidden-input)
 25x -6:08.8.0 core:backspace (input.hidden-input)
     -6:07.1.0 core:paste (input.hidden-input)
     -5:57.7.0 core:select-all (input.hidden-input)
     -5:55.7.0 core:backspace (input.hidden-input)
     -5:54.8.0 core:paste (input.hidden-input)
  2x -5:05.4.0 gpp-compiler:compile (input.hidden-input)
  4x -3:55 core:page-down (div.package-detail)
     -3:52.1.0 core:move-down (div.package-detail)
     -2:22.5.0 script:run-by-line-number (input.hidden-input)
     -2:13.7.0 script:run (input.hidden-input)
 12x -1:31.2.0 gpp-compiler:compile (div.line.cursor-line)

Non-Core Packages

atom-clock 0.1.18 
atom-django 0.3.2 
atom-python-run 0.9.7 
autocomplete-math 0.1.1 
autocomplete-python 1.17.0 
g-code 1.1.0 
gpp-compiler 3.0.7 
ide-c-cpp 0.1.0 
ide-cpp 0.1.0 
ide-python 1.8.0 
kite 0.204.0 
linter 3.3.1 
linter-gcc 0.9.0 
linter-ui-default 3.3.1 
platformio-ide-terminal 2.10.1 
script 3.31.1 

vinothsha avatar Apr 20 '21 16:04 vinothsha

facing same issue , pls update

jeevikasirwani avatar Apr 30 '21 12:04 jeevikasirwani

I am also having the same issue

pasterickg avatar May 05 '21 19:05 pasterickg

same problem, did anyone solve the problem ? would be nice

cedrikwe avatar May 16 '21 14:05 cedrikwe

I can't find a Solution! Anyone have any solutions?

sleepingcat4 avatar Jun 14 '21 07:06 sleepingcat4

i guess i know. #My situation: I was working with Python (everything worked) and then i wanted also to create some C++ files. I added c++ compiler. Run it. And c++ started to work but Python stoped... (here i got that error message)

#Solution: Go to Settings>Packages. Find another compiler package (another programming language) and click on Disable (in my situation i turned off c++ compiler).

After that the problem should be resolved.

RaynorV avatar Aug 01 '21 12:08 RaynorV

Thanks @RaynorV I just disabled my keybindings in gpp compiler settings. There was keystroke "f5" runing command "gpp-compiler:compile". Now it works.

maciejnalewajka avatar Oct 20 '21 19:10 maciejnalewajka

Anyone found a solution for this? I tried disabling the keystrokes, made no difference, I don't have another compiler package installed.

davidhealey avatar Nov 19 '21 00:11 davidhealey

TypeError [ERR_INVALID_ARG_TYPE] [ERR_INVALID_ARG_TYPE]: The "file" argument must be of type string. Received type undefined at validateString (internal/validators.js:112:11) at normalizeSpawnArguments (child_process.js:407:3) at Object.spawn (child_process.js:543:16) at compile (/home/kali/.atom/packages/gpp-compiler/index.js:274:31) at compileFile (/home/kali/.atom/packages/gpp-compiler/index.js:216:5) at HTMLElement.gpp-compiler:compile (/home/kali/.atom/packages/gpp-compiler/index.js:23:11) at CommandRegistry.handleCommandEvent (/usr/share/atom/resources/app/static/:11:352326) at KeymapManager.dispatchCommandEvent (/usr/share/atom/resources/app/static/:11:1227728) at KeymapManager.handleKeyboardEvent (/usr/share/atom/resources/app/static/:11:1223862) at WindowEventHandler.handleDocumentKeyEvent (/usr/share/atom/resources/app/static/:11:286651)

macjaiswal100 avatar Nov 27 '21 04:11 macjaiswal100

TypeError [ERR_INVALID_ARG_TYPE] [ERR_INVALID_ARG_TYPE]: The "file" argument must be of type string. Received type undefined at validateString (internal/validators.js:112:11) at normalizeSpawnArguments (child_process.js:407:3) at Object.spawn (child_process.js:543:16) at compile (/home/kali/.atom/packages/gpp-compiler/index.js:274:31) at compileFile (/home/kali/.atom/packages/gpp-compiler/index.js:216:5) at HTMLElement.gpp-compiler:compile (/home/kali/.atom/packages/gpp-compiler/index.js:23:11) at CommandRegistry.handleCommandEvent (/usr/share/atom/resources/app/static/:11:352326) at KeymapManager.dispatchCommandEvent (/usr/share/atom/resources/app/static/:11:1227728) at KeymapManager.handleKeyboardEvent (/usr/share/atom/resources/app/static/:11:1223862) at WindowEventHandler.handleDocumentKeyEvent (/usr/share/atom/resources/app/static/:11:286651

macjaiswal100 avatar Nov 27 '21 04:11 macjaiswal100

@macjaiswal100 I think you are trying run different code than C++ and atom is trying run it with gpp compiler. Try to disable all compilers without the one you need.

maciejnalewajka avatar Nov 27 '21 08:11 maciejnalewajka

TypeError [ERR_INVALID_ARG_TYPE] [ERR_INVALID_ARG_TYPE]: The "file" argument must be of type string. Received type undefined at validateString (internal/validators.js:112:11) at normalizeSpawnArguments (child_process.js:407:3) at Object.spawn (child_process.js:543:16) at compile (/home/kali/.atom/packages/gpp-compiler/index.js:274:31) at compileFile (/home/kali/.atom/packages/gpp-compiler/index.js:216:5) at HTMLElement.gpp-compiler:compile (/home/kali/.atom/packages/gpp-compiler/index.js:23:11) at CommandRegistry.handleCommandEvent (/usr/share/atom/resources/app/static/:11:352326) at CommandRegistry.dispatch (/usr/share/atom/resources/app/static/:11:350801) at AtomEnvironment.dispatchContextMenuCommand (/usr/share/atom/resources/app/static/:1:786982) at EventEmitter.t (/usr/share/atom/resources/app/static/:1:795036) at EventEmitter.emit (events.js:223:5) at Object.onMessage (electron/js2c/renderer_init.js:115:818)

macjaiswal100 avatar Nov 28 '21 08:11 macjaiswal100

TypeError [ERR_INVALID_ARG_TYPE] [ERR_INVALID_ARG_TYPE]: The "file" argument must be of type string. Received type undefined at validateString (internal/validators.js:112:11) at normalizeSpawnArguments (child_process.js:407:3) at Object.spawn (child_process.js:543:16) at compile (/home/kali/.atom/packages/gpp-compiler/index.js:274:31) at compileFile (/home/kali/.atom/packages/gpp-compiler/index.js:216:5) at HTMLElement.gpp-compiler:compile (/home/kali/.atom/packages/gpp-compiler/index.js:23:11) at CommandRegistry.handleCommandEvent (/usr/share/atom/resources/app/static/:11:352326) at CommandRegistry.dispatch (/usr/share/atom/resources/app/static/:11:350801) at AtomEnvironment.dispatchContextMenuCommand (/usr/share/atom/resources/app/static/:1:786982) at EventEmitter.t (/usr/share/atom/resources/app/static/:1:795036) at EventEmitter.emit (events.js:223:5) at Object.onMessage (electron/js2c/renderer_init.js:115:818)

macjaiswal100 avatar Nov 28 '21 08:11 macjaiswal100

TypeError [ERR_INVALID_ARG_TYPE] [ERR_INVALID_ARG_TYPE]: The "file" argument must be of type string. Received type undefined at validateString (internal/validators.js:112:11) at normalizeSpawnArguments (child_process.js:407:3) at Object.spawn (child_process.js:543:16) at compile (/home/kali/.atom/packages/gpp-compiler/index.js:274:31) at compileFile (/home/kali/.atom/packages/gpp-compiler/index.js:216:5) at HTMLElement.gpp-compiler:compile (/home/kali/.atom/packages/gpp-compiler/index.js:23:11) at CommandRegistry.handleCommandEvent (/usr/share/atom/resources/app/static/:11:352326) at CommandRegistry.dispatch (/usr/share/atom/resources/app/static/:11:350801) at AtomEnvironment.dispatchContextMenuCommand (/usr/share/atom/resources/app/static/:1:786982) at EventEmitter.t (/usr/share/atom/resources/app/static/:1:795036) at EventEmitter.emit (events.js:223:5) at Object.onMessage (electron/js2c/renderer_init.js:115:818)

macjaiswal100 avatar Nov 28 '21 10:11 macjaiswal100

I can't find a Solution! Anyone have any solutions?

the solution that worked for me was by changing the keymap for python (you can change for either) go to settings >packages>select the package>view code>under keymaps change the config and relaunch atom

this fixed the problem for me

himangshusingh avatar Jan 21 '22 13:01 himangshusingh

I had this exact problem just now. Both suggested solutions didn't work for me. What did is changing the name of my file to include the '.cpp' extension. For example: When I had the problem my file was called "test" The problem went away when I changed the file name to: "test.cpp"

Try that and see if it helps.

Jlavack avatar Mar 02 '22 08:03 Jlavack

i found the same problem then i just tought that c/c++ are too compicated then i disable

beltschatsar-01 avatar May 03 '22 12:05 beltschatsar-01

i guess i know. #My situation: I was working with Python (everything worked) and then i wanted also to create some C++ files. I added c++ compiler. Run it. And c++ started to work but Python stoped... (here i got that error message)

#Solution: Go to Settings>Packages. Find another compiler package (another programming language) and click on Disable (in my situation i turned off c++ compiler).

After that the problem should be resolved.

Thanks mate it worked!

ghost avatar Jun 17 '22 17:06 ghost

i facing same issue

smit13192 avatar Aug 27 '22 01:08 smit13192