Skip to content

Can't find module with extension .es6 #9551

@dbaeumer

Description

@dbaeumer

From @aikeru on July 6, 2016 19:0

  • VSCode Version: 1.2.1
  • OS Version: Windows 8.1

Some projects I work on use .es6 extension for JavaScript files that import/export using ES6 module syntax.

While webstorm and webpack seem to have no issues with this setup, VSCode gives a red squiggly saying [js] Cannot find module './filename.es6'.

Is there some way to get VS Code to find modules imported that do not have a .js extension? We would like to use .jsx in a similar fashion.

I have this for a .jsconfig:

    {
        "compilerOptions": {
            "target": "ES6",
            "module": "commonjs"
        },
        "files": [
            "**/*.jsx",
            "**/*.es6",
            "**/*.js"
        ]
    }

...and tried adding .es6 under user settings for VSCode, but suspect I did it wrong or that doesn't solve the issue.

Also opened StackOverflow here:
https://stackoverflow.com/questions/38046039/vs-code-es6-extensions-cant-find-module

Copied from original issue: microsoft/vscode#8816

Metadata

Metadata

Assignees

No one assigned

    Labels

    DuplicateAn existing issue was already createdSuggestionAn idea for TypeScript

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions