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

Uncaught TypeError: Cannot read property 'version' of undefined #768

Open
kaiyoma opened this issue May 20, 2020 · 7 comments
Open

Uncaught TypeError: Cannot read property 'version' of undefined #768

kaiyoma opened this issue May 20, 2020 · 7 comments
Labels

Comments

@kaiyoma
Copy link

kaiyoma commented May 20, 2020

If I try to view prettier debug info inside Atom, I get this:

...\.atom\packages\prettier-atom\dist\displayDebugInfo\index.js:27
Hide Stack Trace
TypeError: Cannot read property 'version' of undefined
    at getDebugInfo (...\.atom\packages\prettier-atom\dist\displayDebugInfo\index.js:27:51)
    at HTMLElement.displayDebugInfo (...\.atom\packages\prettier-atom\dist\displayDebugInfo\index.js:36:11)
    at CommandRegistry.handleCommandEvent (...\AppData\Local\atom\app-1.47.0\resources\app\static\<embedded>:11:349576)
    at Object.didConfirmSelection (...\AppData\Local\atom\app-1.47.0\resources\app\static\<embedded>:11:694812)
    at SelectListView.confirmSelection (...\AppData\Local\atom\app-1.47.0\resources\app\static\<embedded>:11:866372)
    at HTMLDivElement.core:confirm (...\AppData\Local\atom\app-1.47.0\resources\app\static\<embedded>:11:861251)
    at CommandRegistry.handleCommandEvent (...\AppData\Local\atom\app-1.47.0\resources\app\static\<embedded>:11:349576)
    at KeymapManager.dispatchCommandEvent (...\AppData\Local\atom\app-1.47.0\resources\app\static\<embedded>:11:1242036)
    at KeymapManager.handleKeyboardEvent (...\AppData\Local\atom\app-1.47.0\resources\app\static\<embedded>:11:1238170)
    at WindowEventHandler.handleDocumentKeyEvent (...\AppData\Local\atom\app-1.47.0\resources\app\static\<embedded>:11:284782)

Versions:

OS: Windows 10
Atom: 1.47.0
prettier-atom: 0.60.0
prettier: 2.0.5

@robbymarston
Copy link

I've been seeing for weeks myself (but on macOS), renders the package unusable.

@sourdenis
Copy link

same here.
Atom[Enter steps to reproduce:]

  1. ...
  2. ...

Atom: 1.47.0 x64
Electron: 5.0.13
OS: Mac OS X 10.15.4
Thrown From: prettier-atom package 0.60.0

Stack Trace

Uncaught TypeError: Cannot read property 'version' of undefined

At /Users/dev.local/.atom/packages/prettier-atom/dist/displayDebugInfo/index.js:27

TypeError: Cannot read property 'version' of undefined
    at getDebugInfo (/packages/prettier-atom/dist/displayDebugInfo/index.js:27:51)
    at HTMLElement.displayDebugInfo (/packages/prettier-atom/dist/displayDebugInfo/index.js:36:11)
    at CommandRegistry.handleCommandEvent (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:349576)
    at Object.didConfirmSelection (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:694812)
    at SelectListView.confirmSelection (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:866372)
    at HTMLDivElement.core:confirm (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:861251)
    at CommandRegistry.handleCommandEvent (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:349576)
    at KeymapManager.dispatchCommandEvent (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:1242036)
    at KeymapManager.handleKeyboardEvent (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:1238170)
    at WindowEventHandler.handleDocumentKeyEvent (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:284782)

Commands

     -0:32.6.0 core:move-up (input.hidden-input)
     -0:31.4.0 snippets:next-tab-stop (input.hidden-input)
     -0:31.4.0 snippets:expand (input.hidden-input)
     -0:31.4.0 editor:indent (input.hidden-input)
     -0:29.8.0 core:backspace (input.hidden-input)
 19x -0:26.7.0 core:undo (input.hidden-input)
     -0:19.5.0 core:cut (input.hidden-input)
     -0:16.8.0 core:backspace (input.hidden-input)
     -0:16.6.0 core:paste (input.hidden-input)
  2x -0:14.4.0 editor:newline (input.hidden-input)
     -0:11.5.0 core:save (input.hidden-input)
     -0:10 command-palette:toggle (input.hidden-input)
     -0:09.1.0 core:confirm (input.hidden-input)
     -0:09.1.0 prettier:debug (input.hidden-input)
     -0:08.3.0 core:move-down (input.hidden-input)
     -0:08.3.0 editor:newline (input.hidden-input)

Non-Core Packages

atom-material-muted-syntax 1.0.10 
atom-material-numix-syntax 0.2.1 
atom-material-syntax-dark 1.0.0 
atom-material-ui 2.1.3 
autocomplete-javascript 0.0.2 
autocomplete-modules 2.3.0 
base64 0.8.0 
busy-signal 2.0.1 
fast-eslint 4.13.0 
gulp-control 0.5.0 
intentions 1.1.5 
linter 2.3.1 
linter-ui-default 1.8.1 
material 2.2.0 
platformio-ide-terminal 2.10.0 
prettier-atom 0.60.0 
pretty-json 2.1.2 
react 0.18.0 
react-snippets 1.2.0 
touchbar-registry 0.3.2 
touchbar-run 0.1.1 
xml-formatter 0.13.0 

@RodFashion
Copy link

RodFashion commented May 23, 2020

I see the same output when running the Prettier: Debug command.

I'm also on prettier-atom 0.60.0 although my prettier is 2.0.2.

My issue is the Format on Save won't work, but the Prettier: Format does work.

If I turn off both Only format if Prettier is found in your project's dependencies and Only format if a Prettier config is found, then Format on Save works again. If I turn either option on, Format on Save stops working.

I'm guessing there's an issue reading the prettier.config.js and an issue reading the package.json.

@robwise robwise added the bug label Jun 3, 2020
@robwise
Copy link
Collaborator

robwise commented Jun 3, 2020

@RodFashion prettier had a regression in their codebase, that's a known bad version on their part (they made prettier incompatible with the version of node that Atom uses lol), I would update to latest to get format on save working again.

@robwise
Copy link
Collaborator

robwise commented Jun 3, 2020

Will have to look into the debug thing although @robbymarston you should be able to use the plugin overall, it's just the debug that's in question here right all?

@robbymarston
Copy link

@robwise apologies for the delay. Similar to @RodFashion's comment above, Format on Save does not work, but Prettier: Format does.

@robwise
Copy link
Collaborator

robwise commented Jun 5, 2020

@robbymarston Can you confirm you're on latest Prettier version? They regressed their codebase to be incompatible with the verison of Node that Atom uses in a couple of the previous versions but that is now fixed.

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

No branches or pull requests

5 participants