Cannot read property 'split' of undefined when using php-cs-fixer or phpcbf with atom beautify


#1

On all my computers I’ve got a problem with beautifying php files with atom beautify. Both php-cs-fixer and phpcbf give me an error:

Cannot read property ‘split’ of undefined
Hide Stack Trace
TypeError: Cannot read property ‘split’ of undefined
at PHPCSFixer.module.exports.Beautifier.findFile (file:///C:/Users/adamz/.atom/packages/atom-beautify/src/beautifiers/beautifier.coffee:138:24)
at PHPCSFixer.module.exports.PHPCSFixer.beautify (file:///C:/Users/adamz/.atom/packages/atom-beautify/src/beautifiers/php-cs-fixer.coffee:65:39)
at file:///C:/Users/adamz/.atom/packages/atom-beautify/src/beautifiers/index.coffee:355:28
at tryCatcher (C:\Users\adamz.atom\packages\atom-beautify\node_modules\bluebird\js\release\util.js:16:23)
at Promise._settlePromiseFromHandler (C:\Users\adamz.atom\packages\atom-beautify\node_modules\bluebird\js\release\promise.js:512:31)
at Promise._settlePromise (C:\Users\adamz.atom\packages\atom-beautify\node_modules\bluebird\js\release\promise.js:569:18)
at Promise._settlePromise0 (C:\Users\adamz.atom\packages\atom-beautify\node_modules\bluebird\js\release\promise.js:614:10)
at Promise._settlePromises (C:\Users\adamz.atom\packages\atom-beautify\node_modules\bluebird\js\release\promise.js:693:18)
at Promise._fulfill (C:\Users\adamz.atom\packages\atom-beautify\node_modules\bluebird\js\release\promise.js:638:18)
at Promise._settlePromise (C:\Users\adamz.atom\packages\atom-beautify\node_modules\bluebird\js\release\promise.js:582:21)
at Promise._settlePromise0 (C:\Users\adamz.atom\packages\atom-beautify\node_modules\bluebird\js\release\promise.js:614:10)
at Promise._settlePromises (C:\Users\adamz.atom\packages\atom-beautify\node_modules\bluebird\js\release\promise.js:693:18)
at Promise._fulfill (C:\Users\adamz.atom\packages\atom-beautify\node_modules\bluebird\js\release\promise.js:638:18)
at Promise._resolveCallback (C:\Users\adamz.atom\packages\atom-beautify\node_modules\bluebird\js\release\promise.js:432:57)
at Promise._settlePromiseFromHandler (C:\Users\adamz.atom\packages\atom-beautify\node_modules\bluebird\js\release\promise.js:524:17)
at Promise._settlePromise (C:\Users\adamz.atom\packages\atom-beautify\node_modules\bluebird\js\release\promise.js:569:18)
at Promise._settlePromise0 (C:\Users\adamz.atom\packages\atom-beautify\node_modules\bluebird\js\release\promise.js:614:10)
at Promise._settlePromises (C:\Users\adamz.atom\packages\atom-beautify\node_modules\bluebird\js\release\promise.js:693:18)
at Promise._fulfill (C:\Users\adamz.atom\packages\atom-beautify\node_modules\bluebird\js\release\promise.js:638:18)
at PromiseArray._resolve (C:\Users\adamz.atom\packages\atom-beautify\node_modules\bluebird\js\release\promise_array.js:126:19)
at PromiseArray._promiseFulfilled (C:\Users\adamz.atom\packages\atom-beautify\node_modules\bluebird\js\release\promise_array.js:144:14)
at Promise._settlePromise (C:\Users\adamz.atom\packages\atom-beautify\node_modules\bluebird\js\release\promise.js:574:26)
at Promise._settlePromise0 (C:\Users\adamz.atom\packages\atom-beautify\node_modules\bluebird\js\release\promise.js:614:10)
at Promise._settlePromises (C:\Users\adamz.atom\packages\atom-beautify\node_modules\bluebird\js\release\promise.js:693:18)
at Promise._fulfill (C:\Users\adamz.atom\packages\atom-beautify\node_modules\bluebird\js\release\promise.js:638:18)
at Promise._settlePromise (C:\Users\adamz.atom\packages\atom-beautify\node_modules\bluebird\js\release\promise.js:582:21)
at Promise._settlePromise0 (C:\Users\adamz.atom\packages\atom-beautify\node_modules\bluebird\js\release\promise.js:614:10)
at Promise._settlePromises (C:\Users\adamz.atom\packages\atom-beautify\node_modules\bluebird\js\release\promise.js:693:18)
at Promise._fulfill (C:\Users\adamz.atom\packages\atom-beautify\node_modules\bluebird\js\release\promise.js:638:18)
at Promise._settlePromise (C:\Users\adamz.atom\packages\atom-beautify\node_modules\bluebird\js\release\promise.js:582:21)
at Promise._settlePromise0 (C:\Users\adamz.atom\packages\atom-beautify\node_modules\bluebird\js\release\promise.js:614:10)
at Promise._settlePromises (C:\Users\adamz.atom\packages\atom-beautify\node_modules\bluebird\js\release\promise.js:693:18)
at Promise._fulfill (C:\Users\adamz.atom\packages\atom-beautify\node_modules\bluebird\js\release\promise.js:638:18)
at Promise._resolveCallback (C:\Users\adamz.atom\packages\atom-beautify\node_modules\bluebird\js\release\promise.js:432:57)
at Promise._settlePromiseFromHandler (C:\Users\adamz.atom\packages\atom-beautify\node_modules\bluebird\js\release\promise.js:524:17)
at Promise._settlePromise (C:\Users\adamz.atom\packages\atom-beautify\node_modules\bluebird\js\release\promise.js:569:18)
at Promise._settlePromise0 (C:\Users\adamz.atom\packages\atom-beautify\node_modules\bluebird\js\release\promise.js:614:10)
at Promise._settlePromises (C:\Users\adamz.atom\packages\atom-beautify\node_modules\bluebird\js\release\promise.js:693:18)
at Promise._fulfill (C:\Users\adamz.atom\packages\atom-beautify\node_modules\bluebird\js\release\promise.js:638:18)
at Promise._resolveCallback (C:\Users\adamz.atom\packages\atom-beautify\node_modules\bluebird\js\release\promise.js:432:57)
at Promise._settlePromiseFromHandler (C:\Users\adamz.atom\packages\atom-beautify\node_modules\bluebird\js\release\promise.js:524:17)
at Promise._settlePromise (C:\Users\adamz.atom\packages\atom-beautify\node_modules\bluebird\js\release\promise.js:569:18)
at Promise._settlePromise0 (C:\Users\adamz.atom\packages\atom-beautify\node_modules\bluebird\js\release\promise.js:614:10)
at Promise._settlePromises (C:\Users\adamz.atom\packages\atom-beautify\node_modules\bluebird\js\release\promise.js:693:18)
at Promise._fulfill (C:\Users\adamz.atom\packages\atom-beautify\node_modules\bluebird\js\release\promise.js:638:18)
at PromiseArray._resolve (C:\Users\adamz.atom\packages\atom-beautify\node_modules\bluebird\js\release\promise_array.js:126:19)
at PromiseArray._promiseFulfilled (C:\Users\adamz.atom\packages\atom-beautify\node_modules\bluebird\js\release\promise_array.js:144:14)
at Promise._settlePromise (C:\Users\adamz.atom\packages\atom-beautify\node_modules\bluebird\js\release\promise.js:574:26)
at Promise._settlePromise0 (C:\Users\adamz.atom\packages\atom-beautify\node_modules\bluebird\js\release\promise.js:614:10)
at Promise._settlePromises (C:\Users\adamz.atom\packages\atom-beautify\node_modules\bluebird\js\release\promise.js:693:18)
at Async._drainQueue (C:\Users\adamz.atom\packages\atom-beautify\node_modules\bluebird\js\release\async.js:133:16)
at Async._drainQueues (C:\Users\adamz.atom\packages\atom-beautify\node_modules\bluebird\js\release\async.js:143:10)
at Async.drainQueues (C:\Users\adamz.atom\packages\atom-beautify\node_modules\bluebird\js\release\async.js:17:14)
at process._tickCallback (internal/process/next_tick.js:103:7)

Searched this problem on google, but no luck. Anybody had similiar problem?


#2

The stack trace suggests that this is an issue with atom-beautify. You should get in contact with the package’s maintainers about it, on the package’s GitHub repo.