Comments (19)
I had the same problem and I noticed there is a dependence to cheerio
. After checking the installed cheerio
I noticed only cheerio-select
was installed. Since the error was about a missing method (the contents()
) I decided to install cheerio
(npm install cheerio
) and the error was solved.
npm: 3.10.10
node: v6.10.1
gulp-svgstore: 6.1.0
from gulp-svgstore.
Have same problem.
NodeJS: 5.10.0
NPM: 3.8.5
gulp-svgstore: 6.0.0
This error happens even if you use simple:
gulp.task('svgstore', function () {
return gulp
.src('app/assets/svg/*.svg')
.pipe($.svgstore())
.pipe(gulp.dest('out'));
});
I'm fixing it when I remove node_modules folder and all package.json dependencies, and then install it one by one again. Didn't know why it works.
from gulp-svgstore.
Same problem.
NodeJS: 5.7.1
NPM: 3.10.8
gulp-svgstore: 6.1.0
I fixed it by deleting node_modules as @namerci suggested.
from gulp-svgstore.
I have the same problem =(
from gulp-svgstore.
@michaelpumo thanks for the report, I will check it this week.
from gulp-svgstore.
@michaelpumo @nayarahilton I've tried it with the 5.6.0 node and it worked, can you please set up a minimal test case that reproduces the issue?
from gulp-svgstore.
@michaelpumo @nayarahilton is this still an issue for you or may I close this as "can't reproduce"?
from gulp-svgstore.
This still is an issue for me, I'm using 5.7.0 node =/
from gulp-svgstore.
@nayarahilton this is not enough info for me, as I have mentioned earlier, if you need help, please set up a test case that triggers the error.
from gulp-svgstore.
sorry, I'm new here and my problem is similar to him, that's why I do not set up a test case
task:
gulp.task('sprite', function () {
return gulp
.src('./icons/*.svg')
.pipe(svgmin(function (file) {
var prefix = path.basename(file.relative, path.extname(file.relative));
return {
plugins: [{
cleanupIDs: {
prefix: prefix + '-',
minify: true
}
}]
}
}))
.pipe(svgstore())
.pipe(gulp.dest('./img/'));
});
error:
Z:\gulp\node_modules\gulp-svgstore\index.js:107
$combinedDefs.append($defs.contents())
^TypeError: $defs.contents is not a function
at Transform.transform [as _transform](Z:gulpnode_modulesgulp-svgstorei
ndex.js:107:34)
at Transform._read (_stream_transform.js:167:10)
at Transform._write (_stream_transform.js:155:12)
at doWrite (_stream_writable.js:301:12)
at writeOrBuffer (_stream_writable.js:287:5)
at Transform.Writable.write (_stream_writable.js:215:11)
at Transform.ondata (_stream_readable.js:536:20)
at emitOne (events.js:90:13)
at Transform.emit (events.js:182:7)
at readableAddChunk (_stream_readable.js:153:18)
sorry again
from gulp-svgstore.
@nayarahilton but he doesn't set up the test case either. Sorry for confusion, by "the test case" I mean the whole project on github or in a zip archive, that reproduces the issue.
from gulp-svgstore.
Closing as can't reproduce.
Will reopen this issue if somebody uploads a test project that fails with this error.
from gulp-svgstore.
I'll try and get an isolated test case over in the next few days. Apologies for the delay.
from gulp-svgstore.
@michaelpumo and @nayarahilton, I tried your tasks with the exact versions and it worked for me, maybe the problem is in the svg files that you're bundling. Maybe try to remove all svg files and then keep adding them one by one until it breaks.
from gulp-svgstore.
@w0rm I thought perhaps the same, but I tried eliminating each one by one. No success. I'll get an example to you as soon as I can. Should I place this in a repo? Thanks!
from gulp-svgstore.
@michaelpumo any way will work, you can even try to attach a zip file here or email it to [email protected]
from gulp-svgstore.
I'm experiencing this same issue. I've emailed [email protected] with a .zip file of the project.
from gulp-svgstore.
thnx, ramaralo! it's work!
from gulp-svgstore.
Hi @ramaralo,
I would like to say very big THANKS to you. Your comment has helped me to save a lot of hours of googling to try to figure out what's going on.
Cheers ;)
from gulp-svgstore.
Related Issues (20)
- Combine svg's to sprite - apply class attribute to symbols HOT 1
- Incredible "fill" attribute HOT 1
- Name and link for html5boilerplate visuallyhidden class is obsolete in README
- Options for including title and desc tags
- Rendering issues due to <svg> style not being trasferred HOT 3
- css-what dependency is vulnerable to Denial of Service HOT 1
- Fork or pull request for migrate to stack? HOT 2
- Apply class attribute to symbols HOT 1
- "viewBox → viewbox" is bad HOT 5
- <def><style> stops fill: anycolor HOT 3
- defs included outside the symbol HOT 5
- Defs cleanup?? Defs are missing after running svgstore HOT 1
- gulp4 alpha.3 HOT 3
- Styling individual paths through css HOT 1
- Moving away from the Buffer constructor HOT 2
- Content loaded via ajax shows empty icons HOT 3
- UnhandledPromiseRejectionWarning when more than one SVG in the source directory HOT 1
- Problem with globs HOT 2
- Update README to propose automatic fix for `clipPath` issues HOT 1
- No preview files available HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gulp-svgstore.