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
Cannot use "import" in meteor shell
via STDIN
#8823
Comments
The issue can be reproduced using https://github.com/atd/meteor-issue-8823 |
So I guess the cause of the issue is this line
I think I found the solution to the comma syntax mistery The funny thing is that you can build a "meteor shell command injection" and bypass the parenthesis restriction:
So why the parenthesis wrapping when just sending multiple commands seems to work? |
If I recall correctly, the reason was to make sure the code is treated as an expression, so that it evaluates to a value that can be echoed back. Would you mind playing with the |
It seems things work like before: the output shows the value of the last expression
(the server outputs The variables are saved across executions:
There is an additional problem through:
However, they present once the import has been run in a repl
I'd be happy to prepare a pull request. |
An explanation of the |
@atd Thanks for all the digging! I would just point out that we're already implementing our own REPL server, so we have a lot of control over what variables are exposed to it, whereas I think that issue is concerning the default Node REPL. In other words, we should be able to make this work. Please do submit a PR for any changes you'd like to see, even if it's still a work in progress, whenever you get a chance. |
The issue is that I have prepare a quick hack to make them available: #8833 Finally, I am wondering why you don't just pipe the streams in https://github.com/meteor/meteor/blob/devel/tools/shell-client.js I think it would make |
@atd Thanks for looking into this! I think your links are missing the line number anchors (e.g. It's worth pointing out that a lot of the REPL implementation was done before much of the There are new examples in the docs (linked above) so maybe worth re-evaluating those. |
Ok, so tests exposed the reason of the parentheses:
Sorry @abernix which part needs clarification? The reason of why |
@atd I was just pointing out that some of the context you were referring to via |
The prevented to run certain commands in scripts, like `import { Foo } from './bar'` See meteor#8823
Ok, so I was wondering why I think that it would allow process piping at the OS shell level and do more powerful things. Besides using the same code in |
The prevented to run certain commands in scripts, like `import { Foo } from './bar'` See #8823
Should be fixed in |
While using
import
in a normalmeteor shell
worksThe same command using STDIN throws a
SyntaxError
Seen in both meteor
1.4.4.3
and1.5
The text was updated successfully, but these errors were encountered: