Prettier-atom: 0.49.1 Format-on-save: value.split is not a function

Created on 2 Feb 2018  ·  11Comments  ·  Source: prettier/prettier-atom

Hi folks,

since the latest update format-on-save (formatting at all) doesn't work anymore.

Atom: 1.23.3
Prettier: 1.10.2
Prettier-Atom: 0.49.1

Btw: Sorry, but how/where i should execute the command "Prettier:Debug" to get the required output?

Uncaught (in promise) TypeError: value.split is not a function at Diff.lineDiff.tokenize (/Applications/Atom.app/Contents/Resources/app/node_modules/text-buffer/node_modules/diff/lib/diff/line.js:22:38) at Diff.diff (/Applications/Atom.app/Contents/Resources/app/node_modules/text-buffer/node_modules/diff/lib/diff/base.js:36:45) at Object.diffLines (/Applications/Atom.app/Contents/Resources/app/node_modules/text-buffer/node_modules/diff/lib/diff/line.js:47:25) at /Applications/Atom.app/Contents/Resources/app/node_modules/text-buffer/lib/text-buffer.js:625:33 at TextBuffer.module.exports.TextBuffer.transact (/Applications/Atom.app/Contents/Resources/app/node_modules/text-buffer/lib/text-buffer.js:941:24) at TextBuffer.module.exports.TextBuffer.setTextViaDiff (/Applications/Atom.app/Contents/Resources/app/node_modules/text-buffer/lib/text-buffer.js:619:25) at _callee2$ (/Users/freudenreich/.atom/packages/prettier-atom/dist/executePrettier/executePrettierOnBufferRange.js:174:29) at tryCatch (/Users/freudenreich/.atom/packages/prettier-atom/node_modules/regenerator-runtime/runtime.js:62:40) at Generator.invoke [as _invoke] (/Users/freudenreich/.atom/packages/prettier-atom/node_modules/regenerator-runtime/runtime.js:296:22) at Generator.prototype.(anonymous function) [as next] (/Users/freudenreich/.atom/packages/prettier-atom/node_modules/regenerator-runtime/runtime.js:114:21) at step (/Users/freudenreich/.atom/packages/prettier-atom/node_modules/babel-runtime/helpers/asyncToGenerator.js:17:30) at /Users/freudenreich/.atom/packages/prettier-atom/node_modules/babel-runtime/helpers/asyncToGenerator.js:28:13

Thanks in advance!

bug

Most helpful comment

Fok this 💩 Temp fix:apm install [email protected] 🧛‍♂️

All 11 comments

Same here :(
=> prettier-atom doesn't work anymore.
=> Same stack trace

At executePrettier/executePrettierOnBufferRange.js:174 Uncaught (in promise) TypeError: value.split is not a function

here too :(

Fok this 💩 Temp fix:apm install [email protected] 🧛‍♂️

@robwise, this happened to me as well until I did a fresh install of dependencies. Maybe something went wrong during the deploy process?

Sorry, everyone! I will do what I can to get this fixed this weekend.

I would also advise against installing 0.49.0 as there are different issues that you will run into https://github.com/prettier/prettier-atom/issues/361.

I would suggest the following until we can get a corrected build out:

$ apm install [email protected]

I just ran into this issue as well but my stack trace is different. I'll post it here in case it helps.

Atom: 1.23.0
Prettier: 1.9.2
Prettier-Atom: 0.49.1

Uncaught (in promise) TypeError: newText.replace is not a function
    at TextBuffer.module.exports.TextBuffer.setTextInRange (/usr/share/atom/resources/app/node_modules/text-buffer/lib/text-buffer.js:671:35)
    at /usr/share/atom/resources/app/node_modules/text-buffer/lib/text-buffer.js:662:32
    at TextBuffer.module.exports.TextBuffer.transact (/usr/share/atom/resources/app/node_modules/text-buffer/lib/text-buffer.js:941:24)
    at TextBuffer.module.exports.TextBuffer.setTextInRange (/usr/share/atom/resources/app/node_modules/text-buffer/lib/text-buffer.js:660:27)
    at TextEditor.setTextInBufferRange (/usr/share/atom/resources/app/src/text-editor.js:1307:35)
    at _callee2$ (/home/aust/.atom/packages/prettier-atom/dist/executePrettier/executePrettierOnBufferRange.js:176:22)
    at tryCatch (/home/aust/.atom/packages/prettier-atom/node_modules/regenerator-runtime/runtime.js:62:40)
    at Generator.invoke [as _invoke] (/home/aust/.atom/packages/prettier-atom/node_modules/regenerator-runtime/runtime.js:296:22)
    at Generator.prototype.(anonymous function) [as next] (/home/aust/.atom/packages/prettier-atom/node_modules/regenerator-runtime/runtime.js:114:21)
    at step (/home/aust/.atom/packages/prettier-atom/node_modules/babel-runtime/helpers/asyncToGenerator.js:17:30)
    at /home/aust/.atom/packages/prettier-atom/node_modules/babel-runtime/helpers/asyncToGenerator.js:28:13

Thanks for the post! It appears there is still some type of issues with a dependency. So, in the same vain as the proposed solution. Hopefully we can hear from @robwise soon on doing a fresh build and we might be able to solve this at the same time!

The deploy process is just running a script from Atom and everything seemed to deploy fine AFAICT ¯_(ツ)_/¯

Found the source of the bug. Increasing type coverage to prevent this in the future as well.

Verified a bugfix! Just need to merge and publish.

I'm really sorry for all the trouble on this one. ❤️
I'm off to sleep now.

For all people using https://github.com/prettier/prettier-atom/issues/364#issuecomment-362544757 You have to uninstall prettier before installing fixed version. You awe welcome.

Was this page helpful?
0 / 5 - 0 ratings