-
Notifications
You must be signed in to change notification settings - Fork 81
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
Lodash error while generating icons #18
Comments
Sorry to insist but anyone having this issue? |
Btw, I've manually installed an old version of this plugin (0.0.5) and it compiles without any issue. As soon as I upgrade to latest version something breaks. |
Hey Luis, I'm sorry about the delay. |
Hey Thomas, You can find them here: Just tried with the latest versions and still throws the same error. Tks. |
Works fine for me if I use it with one of the provided templates. |
I've updated the gist with the template file, but is exactly what you have in the repo. I've copied again just to be sure. Even when I don't pass the |
Hm, weird. Which versions of node and npm do you have? |
Im running node v0.10.6 and npm 1.4.10 Tried the approach you mention and first I got:
Tried requiring lodash in the gulp file but then it returns:
|
I would suggest updating to 0.10.29. nvm comes in really handy when you want multiple versions running in parallel. In above example, you would need to require lodash first: |
Ok, updated node to 0.10.29 and required lodash in the gulpfile. Also had to install
Despite the error, it did created two font files (svg and ttf), but it seems it didn't finish because some formats missing and no css was generated. |
What happens if you bypass 'use strict';
var gulp = require('gulp'),
plugins = require('gulp-load-plugins')(),
_ = require('lodash');
gulp.task('icons', function(){
return gulp.src(config.ICONS.src)
.pipe(plugins.iconfont({
fontName: config.ICONS.fontname,
fixedWidth: true,
appendCodepoints: false
}).on('codepoints', function(codepoints, options) {
gulp.src('./sass/app/components/icons/_icons-template.scss')
.pipe(plugins.tap(function(file) {
var templateData = {
fontName: options.fontName,
fontPath: '/fonts/',
glyphs: _.map(codepoints, function(codepoint) {
return {
fileName: codepoint.name,
codePoint: codepoint.codepoint.toString(16).toUpperCase()
};
})
};
file.contents = new Buffer(_.template(file.contents.toString(), templateData));
return file;
}))
.pipe(gulp.dest('./sass/app/components/icons/_icons.scss'));
}))
.pipe(gulp.dest(config.ICONS.build));
}); |
First I had to require
Sorry for all the trouble :-( |
Something's wrong with your lodash. What's the output of |
humm.. I get the following:
That's weird, just reinstalled it from NPM and it still outputs the same. |
What's the output of |
That would be:
|
What if you run my reduced example from above (without any other tasks)? |
Now it did created 4 font files, didn't update the CSS, but it returned:
|
Just to be sure: Can you install nvm, run v0.10.29, delete node_modules and run What platform are you on? |
Im not using NVM, upgraded node directly. |
The advantage of nvm would be to have a standardized environment (in case something was wrong with your node installation). Other idea: What's the output if you create a file test.js with the following content and run var _ = require('lodash');
console.log(_); |
running
|
Okay, so what if you add |
I've stripped the gulp file down to just the font generation stuff: Unfortunately the result is the same.
Im sorry for all the trouble, don't want to trouble you more with this. I might resort to use the older version and hope this might solve itself in the near future. |
Can you upload your node_modules folder somewhere? It is really weird that it works with an older version of the plugin but you have the same error when bypassing it using gulp-tap. What if you use gulp-tap and remove gulp-iconfont-css from the package.json (so gulp-load-plugins won't pick it up)? |
I've just placed the node_modules folder on Dropbox, should be available at: The test you suggest still outputs the same error. Also made another test, using the example in the I've noticed that if I pass an invalid path as gulp.src to the
|
The package.json of your lodash module explains a lot: ""A private version of Lo-dash lib, without template() method to bypass CSP restrictions". Emmet might be the culprit: https://github.com/emmetio/lodash |
Can you run |
Wow, that was a nasty and unexpected consequence of using Emmet. Im owing you a coffee or something man. Thank you soo much for all the help. |
You are welcome! Good to know that |
Just wanted to let you guys know that I was having a similar error which I was able to resolve by running Thanks for documenting your fix here and enlightening me about the power of |
The following fixed a bug I was having trying to get angular-fullstack-crud working, with a caveat being that I had to run it from within a subdirectory of the root node_modules for the project. So if it isn't working, look for a nested node_modules directory within one of the subdirectories of the highest-level node_moduels (from project root) and try running it there:
I generated angular-fullstack and then navigated to that directory, added a config.json, installed generator-angular-fullstack-crud. When I tried running yo angular-fullstack-crud it gave me an error:
I could fix this by running npm install from the /node_modules/generator-angular-fullstack-crud/ directory, but it wasn't a good fix because I still ran into this error:
I finally really got the angular-fullstack-crud generator working with:
Thanks for letting me know about the magic of npm cache clean! |
Any idea what might be causing this?
The text was updated successfully, but these errors were encountered: