Skip to content
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

Fix #16675: Better error message for dynamic import with ES2015 modules #23957

Conversation

paulkoerbitz
Copy link
Contributor

Fixes #16675. Following the suggestions in this ticket this PR improves the error message when users try to use dynamic imports while having ES2015 as module in the compiler options.

@@ -895,7 +895,7 @@
"category": "Error",
"code": 1322
},
"Dynamic import cannot be used when targeting ECMAScript 2015 modules.": {
"Dynamic import cannot be used when targeting ECMAScript 2015 modules. Please use 'esnext' or 'commonjs' as module compiler option.": {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how about Dynamic import is only supported when '--module' flag is 'commonjs' or esNext`.

@paulkoerbitz
Copy link
Contributor Author

I agree with the comments and have changed the error message.

@mhegazy mhegazy merged commit 9ea4d93 into microsoft:master May 9, 2018
@mhegazy
Copy link
Contributor

mhegazy commented May 9, 2018

thanks!

@paulkoerbitz
Copy link
Contributor Author

Thanks for this fantastic project!

@paulkoerbitz paulkoerbitz deleted the 16675-better-error-message-for-dynamic-import branch May 21, 2018 21:26
@microsoft microsoft locked and limited conversation to collaborators Jul 31, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants