-
Notifications
You must be signed in to change notification settings - Fork 29.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't find module with extension .es6 #8816
Comments
@aikeru jsx is support but es6 to my knowledge not. Moving to TS team for further clarification. |
TS team: for 2.0 I saw that you support arbitrary file extensions by use setting the kind on open. Would there be more we need to do to make this work. |
This issue was moved to microsoft/TypeScript#9551 |
@dbaeumer I appreciate the quick response and clarification. If I just rename the files to ".js" extension, everything works in VS Code. It's only the difference of extension that seems to matter. I'd like to switch, but you know how it is... :) Does this further confirm that it is, indeed, a TypeScript issue? |
It is a TS issue. Especially when it comes to resolving file. Consider the case weher eyou have a JS file A which import a JS file B. The import statement usually doesn't include the file extension. So the TS/JS server (yes the JS support is power by the TS language server :-)) needs to know the list of valid file extensions that could contain JS code. |
@dbaeumer |
Sadly, this still seems to be an issue in VS Code (January 2017 v1.9) and the issue on the TypeScript repo seems to have been closed without taking this use case into account microsoft/TypeScript#10939 |
+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:
...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
The text was updated successfully, but these errors were encountered: