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

Better error message for using static import in repl #33576

Closed
MylesBorins opened this issue May 27, 2020 · 2 comments
Closed

Better error message for using static import in repl #33576

MylesBorins opened this issue May 27, 2020 · 2 comments
Labels
esm Issues and PRs related to the ECMAScript Modules implementation. repl Issues and PRs related to the REPL subsystem.

Comments

@MylesBorins
Copy link
Contributor

We don't support using static import in the repl, we should give a more meaningful error message

@DerekNonGeneric
Copy link
Contributor

Welcome to Node.js v14.3.0.
Type ".help" for more information.
> import * as ns from './foo.mjs';
import * as ns from './foo.mjs';
^^^^^^

Uncaught SyntaxError: Cannot use import statement outside a module

Linking #32935 to help keep track of this story.

@MylesBorins
Copy link
Contributor Author

Fwiw I almost have a poc done for this

@MylesBorins MylesBorins added esm Issues and PRs related to the ECMAScript Modules implementation. repl Issues and PRs related to the REPL subsystem. labels May 27, 2020
MylesBorins added a commit to MylesBorins/node that referenced this issue Jul 23, 2020
Currently the error is rather ambiguous and does not inform folks that
static import is not supported in the repl. This overrides the default
error message with one that is more informative.

Closes: nodejs#33576
codebytere pushed a commit that referenced this issue Aug 6, 2020
Currently the error is rather ambiguous and does not inform folks that
static import is not supported in the repl. This overrides the default
error message with one that is more informative.

Closes: #33576

PR-URL: #33588
Fixes: #33576
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Guy Bedford <guybedford@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
codebytere pushed a commit that referenced this issue Aug 11, 2020
Currently the error is rather ambiguous and does not inform folks that
static import is not supported in the repl. This overrides the default
error message with one that is more informative.

Closes: #33576

PR-URL: #33588
Fixes: #33576
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Guy Bedford <guybedford@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
MylesBorins added a commit that referenced this issue Nov 3, 2020
Currently the error is rather ambiguous and does not inform folks that
static import is not supported in the repl. This overrides the default
error message with one that is more informative.

Closes: #33576

PR-URL: #33588
Fixes: #33576
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Guy Bedford <guybedford@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
MylesBorins added a commit that referenced this issue Nov 16, 2020
Currently the error is rather ambiguous and does not inform folks that
static import is not supported in the repl. This overrides the default
error message with one that is more informative.

Closes: #33576

PR-URL: #33588
Fixes: #33576
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Guy Bedford <guybedford@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
esm Issues and PRs related to the ECMAScript Modules implementation. repl Issues and PRs related to the REPL subsystem.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants