-
Notifications
You must be signed in to change notification settings - Fork 3k
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
error Parsing error: The keyword 'import' is reserved #84
Comments
It appears babel-node isn't pre-compiling the build tools. What happens when you run this at the root of the project directory?
|
Also encountering this issue. The error I receive is as follows (although this may be because I am running this in a mingw environment on Windows):
Running this script directly in the shell works fine, so I expect my issue is more to do with the fact that Node is opening CMD windows (and not Bash windows) |
@danpantry - Does this issue occur if you run this on the traditional Windows command line? |
When I run |
Odd, I'm seeing issues on my Windows test machine as well. Something has regressed. Thanks for reporting! Investigating.. |
Not a problem - let me know if I can assist further |
Weird. It was running just fine in Git Bash on Windows, but failing on the Windows command line. I now have it working on both. Here's what I did:
And all works fine on the Windows command line for me now. I'm running: Can you please try the above and see if it fixes your issue? Thanks for working with me on this! |
Nope, didn't fix it for me. :( Node 5.5, npm 3.8.1 |
I don't know if this is any help, but I received a very similar problem where all of a sudden I was getting errors about the ES6 syntax in source files I wasn't even in control of (e.g. files from npm packages). However, the error wasn't coming from those files; it was coming from one of my own source files. If I remember correctly, I tried to do something like this:
The problem is that you can't just stick JSX elements like that as the property of an object. This bug in my own code made it seem like a bug was coming from another file, probably the JSX parser file thing. What I'm suggesting is that perhaps the problem is something to do with another file where some sort of syntax rule is being violated. |
@danpantry - You know, @sirpython brings up a good point. Have you changed anything in this repo on your side? Does it run for you with no changes? |
@coryhouse Nope. I just downloaded the repo from source control and had the issue with no modifications. There was a commit made recently in that repo that uses FWIW, both @sirpython and I are using the same repo (the one linked) |
@sirpython really? That's confusing, that should "just work". |
@danpantry Now I'm confused. Why are you sharing a link to an issue in some separate repo? I thought we were discussing an issue in React Slingshot. In Slingshot, babel-node is already being used to run srcServer.js: https://github.com/coryhouse/react-slingshot/blob/master/package.json#L9 If React Slingshot is giving you troubles, I'd like to help, but I need the following:
|
@coryhouse I linked that because that project is using react-slingshot, and that commit shows how the issue was resolved. I have that repo, but from before that commit. Having now updated to that the issue is resolved. That repo (doesn't include node_modules) is (or was) the repo with the issue. We obviously had all the ES6 tools however installed react-slingshot before this commit and as such did not have |
@danpantry Right, I don't think it was that that was causing the bug. IIRC, then the object with the JSX value was being passed to some sort of jsdom rendering method. It was something that the method was doing that caused the problem, I believe. Never mind about what I said, I don't think it's relevant now that I see the react-slingshot wasn't working on its own. |
Okay, then this entire thread is about a bug in your modified copy of React Slingshot, not an actual issue in the current repo, correct? |
@coryhouse No, I don't think so. As @danpantry commented one hour ago, he just downloaded another copy of react-slingshot, made no modifications to it, and it still didn't work. Here's what I could do right now for the specs you requested:
|
To clarify, when I said
I did not mean "I have downloaded it right now". I mean I downloaded it in the past (when I first reported the issue) and had the issue, with no modifications. |
@sirpython - I don't understand what the link you provided has to do with Slingshot. That's not Slingshot - it's a separate repo with many changes. So how would that help convey the bug you're experiencing? |
@coryhouse You asked for the repo we are working with:
However, I don't think this is what Dan is referring to. It'd be best to talk with him. |
The reason I linked the Cardshifter repo was simply that was the repo I was using to replicate the issue. As far as I understand there were not many changes at all to any of the tooling in the Cardshifter repo, it was just react slingshot with some of our working files on top, but no modifications to any of the react-slingshot or webpack process Thus it was my understanding that any issue with the tooling in that repo would be down to an issue in react-slingshot itself |
@coryhouse: `/Users/dragonfly/web-site-works/andromeda-react/tools/startMessage.js:1 SyntaxError: Unexpected token import What could be a problem? |
@bogosavljev Have you run npm install? Also, are you using this repository unchanged? |
Yes, I have follow your steps and didn't change anytihng: I have clone the project. git clone https://github.com/coryhouse/react-slingshot.git. |
@bogosavljev What version of npm and Node are you using? |
npm - 3.6.0 |
@bogosavljev Sorry, I can't reproduce this. I'd suggest installing from scratch in a different directory to see if it persists. |
@coryhouse I have create new folder and follow this steps:
I'm using npm - 3.6.0 and Node - 5.6.0 on iMac late 2015, latest OS, same error occur. |
Hrmm...You might try installing Node 6. Perhaps your Node install has an issue. You can use nvm to run multiple versions. |
That does not helped me. I have installed Node 6.2.2 and npm 3.9.5 |
I think I know what's the problem, when you run |
@rjmreis remove-demo doesn't remove .babelrc. I just tested again to confirm. If that's happening for you then that's a bug. I'd be interested to hear what platform you're on. |
You're right, the problem was when I copied the files over I left out the hidden ones. |
These errors seem to be caused by the absence of having an .eslintrc file at the root of the project (that specifies es6 as the version to be parsed). Confirmed solved for me, at least. Was getting the same errors, tried different ways of npm installing, different webpack config loaders, different versions of python, a reboot, etc. Finally fixed by adding the .eslintrc file in. |
Is this issue still persisting? I see a few fix cases in the chain, and want to confirm this is still an issue. It is unclear what the root issue is. |
its still occurring. |
To add more information its taken me a little while to resolve the issue but i went back into the repo and add back in the following files .babelrc I did see in someone elses comment that they tried putting back in just the .eslintrc on its own but that didn't work. I should have retried after each file. |
@richyrb00 If you remove those critical files, then yes, the repo will break. That's no news. This thread is about an issue that's supposedly happening out of the box. But neither Kyle nor I have been able to reproduce. |
Closing this issue since currently unreproducible. If anyone is still have any issues please file an issue so we can do our best to help. As for the crucial files, if you want to remove these I recommend ensuring you understand their use and do so with proper forethought. If there are any particular questions, let me know I will answer to the best of my ability. Of the ones listed |
I thought that might help others. Because they are probably unzipping copying the files into a preferred folder and then running terminal commands. Because they are copying the files over it's not including the hidden files that I listed. |
If you could put in a PR to update the documentation that would be helpful. On Sat, Oct 15, 2016, 4:07 AM Richard Bilton notifications@github.com
|
i cant intall this
i run in my terminal 3 commands:
Clone the project.
git clone https://github.com/coryhouse/react-slingshot.git.
Install Node packages.
npm install
Run the example app.
npm start -s
and terminal return this messages
The text was updated successfully, but these errors were encountered: