You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was trying to transpile js files using babel cli with the latest upgrade.I had delete keyword in my file so it gave syntax error at that line since by default the files is parsed as es6 modules.Later I got to know from @loganfsmyth that I had to add the --source-type script to let the files be treated as scripts.
By mistake I also run a different version --source-type:"script" which though is syntactically incorrect didn't gave any errors related to bad arguments, rather it simply gives a BABEL_PARSE_ERROR at that delete keyword line.So the point is it should give a command error rather than giving an error which can mislead someone to think that the issue is again related with babel operating in strict mode.
I am attaching the screenshot.The first command in image gives an error while second one works just fine.
The text was updated successfully, but these errors were encountered:
Hey @shashank-13! We really appreciate you taking the time to report an issue. The collaborators
on this project attempt to help as many people as possible, but we're a limited number of volunteers,
so it's possible this won't be addressed swiftly.
If you need any help, or just have general Babel or JavaScript questions, we have a vibrant Slack
community that typically always has someone willing to help. You can sign-up here
for an invite.
loganfsmyth
changed the title
Babel transpiling files as scripts.
--source-type:"script" should given an error about an unknown argument (probably)
Aug 31, 2018
I was trying to transpile js files using babel cli with the latest upgrade.I had delete keyword in my file so it gave syntax error at that line since by default the files is parsed as es6 modules.Later I got to know from @loganfsmyth that I had to add the --source-type script to let the files be treated as scripts.
By mistake I also run a different version --source-type:"script" which though is syntactically incorrect didn't gave any errors related to bad arguments, rather it simply gives a BABEL_PARSE_ERROR at that delete keyword line.So the point is it should give a command error rather than giving an error which can mislead someone to think that the issue is again related with babel operating in strict mode.
I am attaching the screenshot.The first command in image gives an error while second one works just fine.
The text was updated successfully, but these errors were encountered: