HelloWorld017 / atom-discord

Integrate with Discord and show Rich Presence information.
https://atom.io/packages/atom-discord
MIT License
105 stars 28 forks source link

Object.basename is deprecated. #43

Closed 1ceSpark closed 6 years ago

1ceSpark commented 6 years ago

Reported from the atom deprecated calls panel, i didn't have this error before the last update:

Arguments to path.basename must be strings

Object.basename (C:\Users\User\AppData\Local\atom\app-1.21.1\resources\app.asar\src\electron-shims.js:31:10)
updateProjectName (C:\Users\User\.atom\packages\atom-discord\src\index.js:72:23)
atom.workspace.onDidChangeActiveTextEditor (C:\Users\User\.atom\packages\atom-discord\src\index.js:81:4)
Function.module.exports.Emitter.simpleDispatch (<embedded>:65955:20)
Emitter.emit (<embedded>:66071:34)
Workspace.didChangeActivePaneItemOnPaneContainer (<embedded>:27939:30)
Ekidoxx commented 6 years ago

When did it happen? Right after Atom loaded with file-tab, any other tab (i.e. settings) or with no tabs open?


Maybe else projectName = null should instead be else projectName = "" or refer to i18n project-no-name ?

Sent from my Galaxy S6 using FastHub

HelloWorld017 commented 6 years ago

path.basename(atom.project.relativizePath(onlineEditor.buffer.file.path)[0])

I should have checked the result of relativizePath.

Ekidoxx commented 6 years ago

@HelloWorld017 Ok, just got on my PC, and I can't manage to reproduce the error no matter what I try... ._.

@wyysel You'd mind sharing some more info about your working environment, like operating system, Atom version, and if it happens every time or just from time to time?

HelloWorld017 commented 6 years ago

I found that projectPath The String path to the project directory that contains the given path, or null if none is found. from API documentation.

1ceSpark commented 6 years ago

@Ekidoxx @HelloWorld017 Sorry i couldn't answer you earlier. :/ Rn I still have the error (it started after i updated to the new version of your package the 23/01), and i didn't updated atom since that normally. I am on windows 10 build 1709 (64-bits) and my atom is up to date V1.23.3 The rich presence seems working even i have the error, i shared it here only to let you know it, probably I am not the only one who have it.

The message shows immediately after i open a file: image

Also the screenshot of the deprecation cop (the panel which opens when i click the little message above), it reported the bug here automatically when i clicked the "report issue" button: image

Any other way i could help you? Also sry because you just closed this issue...