-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Compiling of 'web/static/js/app.js' failed due to "es2015" #1410
Comments
You just need to install the babel es2015 preset. https://www.npmjs.com/package/babel-preset-es2015
|
|
@chrismccord @bryansray The following option worked for me being that I wasn't ready to pull the trigger with
Will |
I don't believe there is anything for us to add. Like I said, I had to do this on one project, but not another. When I blew away my
|
@chrismccord For step 2, one can also use the following command:
I'm up and operational without the preset. |
Glad to hear it, but bizarre nonetheless. I'm sure we'll be pointing folks to the |
Actually you need to have node 5.x , (5.1.0 ? ) After updating to 5.1.0, removing the node_modules dir and running npm install again, everything was fine. |
Leaving this open as I'm sure we'll get folks running into it. It does appear node v5 is now required, but it's not immediately clear why. In any case, node v5 and |
I'm one of them and upgrading from node v4 to v5 indeed fixes the problem. The official guide (which I was following along) mentions you need |
yes, sorry, will fix. Thanks! |
Thanks for fixing it (that was quick!). And no worries, the guides have been great so far. |
paging @paulmillr hoping he can shed some light on this. Anything we're missing here around babel-brunch issues with node < 0.5? |
No ideas. Let's investigate this. |
TL;DR(Edited to be really clear about what needs done)
Not a
|
@realistschuckle does this mean we can close the issue and point folks to this solution? |
@paulmillr it feels like so. We are keeping this open in any case to help folks find the solution. :) |
This doesn't seem to be working for me. I'm on mac 10.11.2.
|
@Inconditus what is your npm version? |
Seems like |
Homebrew here has installed node 5.1.1 and npm 3.3.12. With those versions installed, blowing away |
@Inconditus @paulmillr @josevalim Is there anything else I can do to make this better for a brighter tomorrow? |
I had this issue initially on my local machine but followed this answer on SO and overcame it. I've run into the problem again with running on Heroku. I've included node_version=5.3.0 in my phoenix_static_buildpack.config file. This updates the version of node to 5.3. Once it's updated, how do I go about removing the node modules and clearing the cache/resetting the remote environment on Heroku? edit: A crude workaround to get it working on Heroku - destroy the app and remake it. All works as intended when using the correct version of Node from the start. |
I'm able to repro this using npm 3.5.2 and node 5.3.0. I also blew away my ~/.npm and node_modules directory without any luck. |
@danschultz, can you give me a little more information like your OS, top-level contents of your node_modules directory, and maybe your brunch config? |
@realistschuckle here you go: OS: Mac OS 10.11.1 Update Also, not sure if it matters, but I'm using a umbrella Mix project. |
@realistschuckle it seems my issue may be related to using an umbrella project. I created a new Phoenix app outside my umbrella project and the assets compile fine. |
The babelrc is strictly for phoenix-core development, not for generated projects. The .babelrc should not be required for any projects on latest node/npm/brunch versions |
Just to document my workflow - i've done this twice with two fresh machines: node - v5.5.0
Confirmed, adding a .babelrc to root does indeed fix this issue for both machines. I've also tried:
Update/FIX: Deleting There isn't really any good documentation on the proper use case of .babelrc, but to fix this issue for people who are improperly configured, you can simply tell babel-brunch not to look for a babelrc and it works great. In my opinion its a partially sensible default - but it might be confusing for someone who wants to use a babelrc in this case. I think the main problem stems from a misconception on how babelrc works, in comparison to the likes of eslintrc, where its permissible to set your global configuration in your home directory. |
I had a .babelrc in the parent directory from the phoenix project. Deleting it indeed resolved the issue. |
@mos8580 I actually asked you to try making that in the pheonix project directory so that was probably my fault :( ideally its not having one at all that eventually fixed my issue. Unless you mean the parent direct above the pheonix directory - ex: I keep my code in ~/Code, so my parent directory would be ~/ I'm at guilt for following a guide somewhere or automatically assuming the .babelrc as a global configuration was a good option as well :( |
@Eein To be honest I tried just about everything anyway. I think that behaviour of Babel is a bit sneaky, but that's my bad for not knowing the tooling. Thank you for for finding the real solution =] |
I have the exact same issue as described by Eein 28 days ago. |
Make sure you're on Brunch 2.5, node 4+ and npm 3+. |
you can also do the following
|
Could we close the issue? I think that's been long resolved since be we don't have new comments @chrismccord |
<3 <3 <3 |
Just had the issue, and this was the quick fix: npm install --save-dev babel-preset-es2015 Thanks! |
Adding "babel-preset-es2015": "^6.9.0", or similar to the devDependencies in package.json is still required it seems, had to do this with a fresh install last night (Phoenix 1.2.0) |
@mikekreuzer Which versions of node/npm are you using? I haven't encountered this with new projects for months. |
Node's 6.3.0, npm was 3.10.3, 3.10.5 now, using nvm if that's significant. Node weirdness is why I'm using Phoenix. :-) |
The dependency should be provided by babel-brunch. Can you run If you can push your repository with this issue, that would also be helpful. |
Working after adding it manually: And also working out of the box now on another fresh project: Neither's on a repo, I threw them up to test something unrelated... but it seems to be working for me now too (annoyingly). |
The only thing worked for me was running this command on ubuntu: sudo npm install --save-dev babel-preset-es2015 |
As a late addition. Deleted node_modules and used the new facebook Yarn tool and got a working result. |
Good topic for first use phoenix! |
Just wanted to leave a note that I can reproduce the issue with 1.3.0 rc2. OS : MacOS 10.12.5 STR:
Actual result : Expected result: Workaround: It should be noted that mix phoenix.new works without issue. |
Managed to build a development app stored inside
|
For context, I'm working through the example on page 37 of "Programming Phoenix" PDF section "Creating the Project". In order to reproduce this issue, I performed the following:
Error
The text was updated successfully, but these errors were encountered: