-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
[6.2] Unknown plugin "transform-es2015-arrow-functions" specified in "../foundation-sites/.babelrc" at 0" #8255
Comments
@colin-marshall that's missing |
@erutan |
So far the solution for me includes uninstalling and reinstalling everything and doing manual global installs of packages because NPM doesn't quite manage packages despite the name. :/ Not entirely sure if |
@erutan I was wrong. I was able to reproduce the issue and it comes down to that you need to install |
@colin-marshall I think there's a number of different issues that can crop up in the process. The TypeError issue only happens once you have babel-register itself running, which it seems a lot of us aren't able to do following docs (I'm assuming that some people at Zurb had stuff installed globally and missed some of the install issues - understandable and it's a big point release). |
Also, the reason that |
And yes we definitely need to document that gulp 4.0 needs to be installed globally and look into what issues might arise from that with older projects. |
It's possible then that using the In the course of my research it seems like it's all a little squirrely at the moment, given the number of conflicting solutions in other github / stackoverflow issues. :) |
@erutan I deleted my initial post in this issue to minimize confusion (and because it was incorrect). I guess we need to see @JeremyEnglert's |
Anyways I really appreciate being able to leverage the work in Foundation, even though 6 has been a bit more taxing than 5 in a few ways. It's a big rewrite, so I'm sorta treating it like when Apple comes out with a redesigned pro app and things are a bit ragey until the next version comes out. :p |
@colin-marshall - here is my package.json file. {
"name": "JointsWP-sass",
"version": "4.0.0",
"description": "A WordPress starter theme using Foundation 6",
"repository": {
"type": "git",
"url": "https://github.com/JeremyEnglert/JointsWP.git"
},
"author": "Jeremy Englert",
"license": "GPL-2.0 AND MIT",
"homepage": "https://github.com/JeremyEnglert/JointsWP",
"devDependencies": {
"babel-preset-es2015": "^6.5.0",
"browser-sync": "^2.11.0",
"gulp": "^3.9.0",
"gulp-autoprefixer": "^2.3.1",
"gulp-babel": "^6.1.2",
"gulp-bower": "0.0.10",
"gulp-concat": "^2.5.2",
"gulp-cssnano": "^2.1.1",
"gulp-jshint": "^1.11.0",
"gulp-plumber": "^1.0.1",
"gulp-rename": "^1.2.2",
"gulp-sass": "^2.0.1",
"gulp-sourcemaps": "^1.6.0",
"gulp-uglify": "^1.2.0",
"gulp-util": "^3.0.5",
"jshint-stylish": "^2.0.0"
}
} |
@JeremyEnglert I'm getting the same error trying to upgrade wp-foundation-sites. Lemme know if you find a solution. |
@andycochran check out some of the solutions in #8256 update: meant more the link to the yeoman issue than my gulp fix, sorry: yeoman/generator-webapp#356 (comment) |
Thanks, @erutan. @JeremyEnglert I'm pretty sure I'm having the exact issue as you, especially since I based a lot of my wp-foundation-sites theme off of your Joints theme. I don't get the type error discussed in #8256. So, it's not a Gulp version issue. This isn't a nice solution, but what worked for me is including all of these Babel plugins in the theme's "babel-plugin-transform-es2015-modules-commonjs": "^6.3.13",
"babel-plugin-transform-es2015-arrow-functions": "^6.3.13",
"babel-plugin-transform-es2015-block-scoped-functions": "^6.3.13",
"babel-plugin-transform-es2015-block-scoping": "^6.4.0",
"babel-plugin-transform-es2015-classes": "^6.3.15",
"babel-plugin-transform-es2015-destructuring": "^6.3.15",
"babel-plugin-transform-es2015-parameters": "^6.3.26",
"babel-plugin-transform-es2015-shorthand-properties": "^6.5.0",
"babel-plugin-transform-es2015-spread": "^6.4.0",
"babel-plugin-transform-es2015-template-literals": "^6.3.13",
"babel-register": "^6.5.2", Then running Harrumph. 😔 |
@JeremyEnglert FWIW, you'll need to add |
I was able to "fix" the issue by completely removing the .babelrc from foundation-sites. The JS appears to compile without errors. But I'm going to see if it compiles differently when all of the Babel plugins are added to the package.json file. |
There's a JS bug with 6.2.0 that prevents the Foundation JS from compiling because of babel plugin errors. Until then, we're placing a hard version operator at 6.1.1 until the bug gets resolved. See: foundation/foundation-sites#8255
Same issue happening for me as well. I was able to compile the Foundation JS by also completely removing the |
@jacobarriola have you tried including the |
Okay - here's what I've figured out. As @andycochran pointed out, adding all of the Babel plugins to the project/theme does "fix" the issue. However, removing .babelrc from foundation-sites also fixes the issue. And both ways end up compiling the same end result. So I guess it comes down to this: should .babelrc be included with the bower version of foundation-sites? I would argue that it should be left out - as the only people who will truly bennefit from it are those working inside of the foundation-sites directory. Most users (from what I can tell), simply reference these files and use their own methods to compile. PS - Simply using babel-preset-es2015 seems to load all of the plugins that are currently being individually called - is there a reason that isn't being used instead? |
@JeremyEnglert multiple people have found swapping out the plugin preset fixed the problem for them, read through the sister thread which has been linked here a few times. Are you sure that babel is still transplicing? If you're getting ES2015 as output that doesn't leave you with a lot of browser support. |
The output is here: https://github.com/JeremyEnglert/JointsWP/blob/master/assets/js/foundation.js I think this may be a NPM and/or Node version issue. On my local machine, I'm running NPM 3.4.0 and Node 4.2.2 and everything works fine (with or without the .babelrc file). On my work machine, I'm running older versions of NPM and Node - that's when the issue arrises. But I still have to question the necessity of including .babelrc in the Foundation-Sites bower install. Shouldn't those plugins be declared in the project itself? As noted above, I get the same result whether that file is included or not (because I'm declaring my own .babel plugins in the gulpfile.js - as I assume most people do). https://github.com/JeremyEnglert/JointsWP/blob/master/gulpfile.js#L87 |
Took me an hour to get 6.2 work with gulp / babel. Ended up removing .babelrc from Foundation and then it worked just fine. Installing Gulp 4 globally doesn't seem to be a good idea to me. I've set the babel preset like below, because I don't have that installed globally either: .pipe(babel({
presets: [__dirname + '/node_modules/babel-preset-es2015']
})) |
Is there any benefit to having the .babelrc included with the bower install of Foundation? It makes sense for the foundation-template, but for the bower install, it seems to cause more issues than good. |
Agreed. |
thank you andycochran - adding the babel plugins to package.json resolved this issue for me |
Sorry if this is just from me not setting this up correctly. The .babelrc file included with the bower install of Foundation seems to be causing issues.
Error:
ReferenceError: Unknown plugin "transform-es2015-arrow-functions" specified in "/Users/jeremy/Documents/Sites/jointswp-github/wp-content/themes/JointsWP-sass/vendor/foundation-sites/.babelrc" at 0
When I remove the .babelrc file, everything compiles fine.
Here is the Gulp task:
The text was updated successfully, but these errors were encountered: