bcrypt.js icon indicating copy to clipboard operation
bcrypt.js copied to clipboard

Remove var module declaration from minimal-env.js

Open dustingraham opened this issue 5 years ago • 5 comments

Howdy,

Of course it is up to your discretion if you want to make this change. I just want to bring it to your attention.

Once I installed bcrypt for password hash checking, the module.exports support in WebStorm IDE is failing.

I found others had been running into this as well:

  • https://stackoverflow.com/questions/43864913/intellij-inspection-saying-module-exports-does-not-exist-for-nodejs

bcrypt.js/externs/minimal-env.js

I've gone into /node_modules/ and marked minimal-env as plain text so this suppresses the issue in my current environment, but I'll need to remember it for each workstation I use and each project where I pull this in. Minor annoyance, but thought you might be able to consider avoiding the var module; declaration.

Thanks.

dustingraham avatar Oct 07 '19 23:10 dustingraham

Yes! Was about to create an issue about this, doesn't seem like its getting anyone's attention though.

MohamedElidrissi avatar Nov 22 '19 11:11 MohamedElidrissi

Yes, very annoying. Of course, it's not your package's fault. For anyone coming here from Google searches, a quick fix is to right click minimal-env.js and choose 'Mark as Plain Text'.

vdavid avatar Nov 28 '19 07:11 vdavid

Yes, very annoying. Of course, it's not your package's fault. For anyone coming here from Google searches, a quick fix is to right click minimal-env.js and choose 'Mark as Plain Text'.

@vdavid It works for me. Thanks!

andorep avatar Dec 23 '19 23:12 andorep

@vdavid Yes. I explained that you can right click minimal-env.js and 'Mark as Plain Text' in the original issue. I'm not sure if "not your package's fault" is quite accurate. Most IDEs are designed to crawl packages and provide syntax highlighting and type hinting.

This issue is a report that this declaration causes folks that use an IDE with type hinting to have to take a couple extra steps for any project where this package is used. I was suggesting avoiding it or removing it to make things a little easier on that subset of users. If the author chooses not to, that's their call and is fine by me. :) But, the fact that folks end up here via Google is due to this minimal-env.js script. My opinion of course.

dustingraham avatar Dec 24 '19 00:12 dustingraham

Not just var module but also process

mdhishaamakhtar avatar Nov 05 '20 04:11 mdhishaamakhtar