ericadamski / atom-medium

Upload posts directly to medium for the Atom text editor
MIT License
6 stars 2 forks source link

Uncaught TypeError: pack.public is not a function #13

Closed jaredmorgs closed 6 years ago

jaredmorgs commented 6 years ago

I just installed the package and attempted to authenticate to Medium using my Google ID as the login method. I'm already a Medium user and have a validated account. I got a 400 bad request after entering my 2FA number.

I got a false message about the service being alive (because it probably created the authentication token) but when I select the .md file to "Use as Medium Post" and try to post a draft, I get a "There was an error drafting your post {}" message.

When I try to post to Public, I get the followin stacktrace.

Atom: 1.23.1 x64 Electron: 1.6.15 OS: Mac OS X 10.13.1 Thrown From: medium-upload package 0.1.3

Stack Trace

Uncaught TypeError: pack.public is not a function

At /Users/jaredleonmorgan/.atom/packages/medium-upload/lib/medium-upload-view.js:105

TypeError: pack.public is not a function
    at /packages/medium-upload/lib/medium-upload-view.js:105:58)
    at HTMLButtonElement.dispatch (/packages/medium-upload/node_modules/jquery/dist/jquery.js:5206:27)
    at HTMLButtonElement.elemData.handle (/packages/medium-upload/node_modules/jquery/dist/jquery.js:5014:28)

Commands

     -2:40.2.0 medium-upload:toggle (div.package-detail.panels-item)
  2x -2:23.9.0 editor:newline (input.hidden-input)
     -2:16.2.0 medium-upload:toggle (input.hidden-input)
     -2:10.1.0 core:save (ul.list-inline.tab-bar.inset-panel)
  3x -1:58.1.0 medium-upload:toggle (div.lines)

Non-Core Packages

asciidoc-assistant 0.2.2 
asciidoc-preview 2.10.3 
language-asciidoc 1.11.0 
language-markdown 0.25.1 
markdown-preview-plus 2.4.16 
medium-upload 0.1.3 
ericadamski commented 6 years ago

@jaredmorgs Thank you for submitting the issue! I havn't tested 2 factor authentication so it may just be that there is a new flow this package has to support. I can take a look into it for you :)

ericadamski commented 6 years ago

I think the issue stems from this like here https://github.com/ericadamski/atom-medium/blob/928b3964a4658bb7f0c4129b4234165139d7a5ee/lib/medium-upload.js#L107 We are trying to call https://github.com/ericadamski/atom-medium/blob/928b3964a4658bb7f0c4129b4234165139d7a5ee/lib/medium-upload-view.js#L105 But public isn't a function it is actually publish so I will test this and get a hotfix out as soon as possible!

jaredmorgs commented 6 years ago

I'll be happy to test once you've patched it.

I'm migrating away from a roll your own static site so have plenty of posts to test with.

ericadamski commented 6 years ago

@jaredmorgs I published a patch update to v0.1.4 that should fix this problem, please let me know if you are stilling having issues! Thank you!!!