How to hide ".js" extension on import popup options


In a node.js project, 

When I try to import a module from a file in my project, 

the auto complete popup options shows the file with ".js" extension (there is no option without it).

I also verified if "Use file extension in module name" is disabled in Settings | Editor | Code Style | JavaScript  and that checkbox is indeed disabled.

I'm using WebStorm 2020.


Is there a way to add an option to import the file without its ".js" extension?



Comment actions Permalink

it's not added by default, unless Use file extension in module name is enabled.

Could you record a screencast that shows up the issue?

Comment actions Permalink

Elena Pogorelova

Yes, I couldn't attach a video clip here (used an hosting website)


Here is a screenshot as well

Comment actions Permalink

The page can't be loaded unfortunately...

For me, the file is shown with extension in completion, but completed without it

Could you share your idea.log (Help > Show Log in ...) and your settings (File > Manage IDE Settings > Export settings...)?

Comment actions Permalink

weird indeed... Even with your settings, the problem is not repeatable for me, and I can't see anything suspicious in your log.

Can you reproduce the issue in a new project?

Comment actions Permalink

I think that I figured it out now,

There are 2 options of the file that I want to import (schema.js),

I should select the option with the "js" icon as shown in the screenshot below if I want it to be without the ".js" extension.

The other option (without the icon) will import it with the ".js" extension.

Thanks Elena Pogorelova


Please sign in to leave a comment.