-
Notifications
You must be signed in to change notification settings - Fork 147
SyntaxError: 'import' and 'export' may appear only with 'sourceType: module' #55
Comments
Hi @tmanderson! That's a parse error from acorn. I'm unable to repro in similating your setup. |
Thanks @tmanderson! You've got the options specified incorrectly. |
@jdalton, ah! I gotcha. Had a feeling it might be something like that. Thanks for the quick response! |
BTW I updated the parser error message to avoid confusion with |
Ah, very nice. I'm hoping that'll save someone from the same mistake! Thanks again. |
@jdalton - you should clearly indicate in README that one has to include additional information into the packages.json, or "this magic" will not work. |
@theKashey I do |
Yep, but this is not very clear :( Will NOT work out of the box for JS files. See below.As for me - I have read the medium article, tried to run scripts, checked readme.. And understand my problem only here. |
@theKashey Would you be up for creating a PR to update the readme? |
Will do my best. |
I'm seeing this error:
Sorry if this is completely my mistake, but I can't seem to find anything in the README referring to the
sourceType: module
setting?My package.json contents:
I'm running my script with the following command:
Where index.js contains:
I've also tried
import chalk from './node_modules/chalk
and./node_modules/chalk/index
with no luck.I have verified that
chalk
is installed. Thanks!The text was updated successfully, but these errors were encountered: