Skip to content
This repository has been archived by the owner on Jan 16, 2023. It is now read-only.

Uncaught TypeError: Cannot read property 'toString' of undefined #69

Open
vickybiswas opened this issue Sep 2, 2017 · 4 comments
Open

Comments

@vickybiswas
Copy link

[Enter steps to reproduce:]

  1. Create a simple HTML
  2. Run the plugin

Atom: 1.19.5 x64
Electron: 1.6.9
OS: Mac OS X 10.12.6
Thrown From: php-cs-fixer package 4.1.1

Stack Trace

Uncaught TypeError: Cannot read property 'toString' of undefined

At /Users/vickybiswas/.atom/packages/php-cs-fixer/lib/php-cs-fixer.coffee:134

TypeError: Cannot read property 'toString' of undefined
    at Object.fix (/packages/php-cs-fixer/lib/php-cs-fixer.coffee:134:72)
    at /packages/php-cs-fixer/lib/php-cs-fixer.coffee:106:84)
    at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/Applications/Atom.app/Contents/Resources/app/src/command-registry.js:265:35)
    at CommandRegistry.handleCommandEvent (/Applications/Atom.app/Contents/Resources/app/src/command-registry.js:3:65)
    at CommandRegistry.module.exports.CommandRegistry.dispatch (/Applications/Atom.app/Contents/Resources/app/src/command-registry.js:166:25)
    at AtomEnvironment.module.exports.AtomEnvironment.dispatchApplicationMenuCommand (/Applications/Atom.app/Contents/Resources/app/src/atom-environment.js:1338:34)
    at EventEmitter.outerCallback (/Applications/Atom.app/Contents/Resources/app/src/application-delegate.js:334:31)
    at emitThree (events.js:116:13)
    at EventEmitter.emit (events.js:194:7)

Commands

     -3:12.6.0 core:move-down (input.hidden-input)
     -3:09.5.0 core:paste (input.hidden-input)
     -3:07.3.0 core:move-down (input.hidden-input)
  4x -3:06.6.0 core:select-down (input.hidden-input)
     -3:04.8.0 core:backspace (input.hidden-input)
  2x -3:03.5.0 core:move-down (input.hidden-input)
 14x -3:02.7.0 core:select-down (input.hidden-input)
     -3:00.9.0 core:select-up (input.hidden-input)
     -3:00.3.0 core:select-down (input.hidden-input)
     -2:59.4.0 core:backspace (input.hidden-input)
     -2:55.9.0 core:save (input.hidden-input)
     -2:48.1.0 core:select-all (input.hidden-input)
     -2:47.2.0 core:cut (input.hidden-input)
     -0:40.8.0 core:undo (input.hidden-input)
     -0:22.3.0 core:move-right (input.hidden-input)
     -0:11 php-cs-fixer:fix (input.hidden-input)

Non-Core Packages

git-plus 7.9.3 
php-cs-fixer 4.1.1 
php-integrator-linter 0.2.1 
php-integrator-linter-legacy-php56 1.3.1 
quick-editor 0.4.3 
remote-edit 1.9.0 
remote-sync 4.1.5 
sass-autocompile 0.13.3 
@femartin
Copy link

Same problem

@KEINOS
Copy link

KEINOS commented Jun 9, 2018

Same problem

ATOM: 1.27.2 x64
OS: macOS HighSierra ( OSX 10.13.5)
Thrown From: php-cs-fixer package 4.1.1

Code Tested

Not saved and run [Package]-[php-cs-fixer]-[FIX(^⌘S)].

<?php

echo sayHello();

function sayHello(){
  return 'Hello world!';
}

Stack Trace

TypeError: Cannot read property 'toString' of undefined
    at Object.fix (/Volumes/Macintosh_SD/Users/admin/.atom/packages/php-cs-fixer/lib/php-cs-fixer.coffee:134:72)
    at HTMLElement.subscriptions.add.atom.commands.add.php-cs-fixer:fix (/Volumes/Macintosh_SD/Users/admin/.atom/packages/php-cs-fixer/lib/php-cs-fixer.coffee:106:84)
    at CommandRegistry.handleCommandEvent (/Applications/Atom.app/Contents/Resources/app/src/command-registry.js:384:49)
    at CommandRegistry.dispatch (/Applications/Atom.app/Contents/Resources/app/src/command-registry.js:273:23)
    at AtomEnvironment.dispatchApplicationMenuCommand (/Applications/Atom.app/Contents/Resources/app/src/atom-environment.js:1347:25)
    at EventEmitter.outerCallback (/Applications/Atom.app/Contents/Resources/app/src/application-delegate.js:339:53)
    at emitThree (events.js:116:13)
    at EventEmitter.emit (events.js:197:7)

Non-Core Packages

atom-autocomplete-php 0.25.6
japanese-menu 1.14.9
linter-php 1.5.1
php-cs-fixer 4.1.1
teletype 0.13.3

@Daksh14
Copy link

Daksh14 commented Aug 5, 2019

Same problem

@CyberMarsl
Copy link

Fix error messsage by setting the php path.

I have seen this issue if the php path is not set. Setting the php path in settings of this module solves the 'toString' problem.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants