Git Product home page Git Product logo

Comments (19)

ramaralo avatar ramaralo commented on June 15, 2024 5

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.

psalkowski avatar psalkowski commented on June 15, 2024 1

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.

amie-wilt avatar amie-wilt commented on June 15, 2024 1

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.

nayarahilton avatar nayarahilton commented on June 15, 2024

I have the same problem =(

from gulp-svgstore.

w0rm avatar w0rm commented on June 15, 2024

@michaelpumo thanks for the report, I will check it this week.

from gulp-svgstore.

w0rm avatar w0rm commented on June 15, 2024

@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.

w0rm avatar w0rm commented on June 15, 2024

@michaelpumo @nayarahilton is this still an issue for you or may I close this as "can't reproduce"?

from gulp-svgstore.

nayarahilton avatar nayarahilton commented on June 15, 2024

This still is an issue for me, I'm using 5.7.0 node =/

from gulp-svgstore.

w0rm avatar w0rm commented on June 15, 2024

@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.

nayarahilton avatar nayarahilton commented on June 15, 2024

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.

w0rm avatar w0rm commented on June 15, 2024

@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.

w0rm avatar w0rm commented on June 15, 2024

Closing as can't reproduce.

Will reopen this issue if somebody uploads a test project that fails with this error.

from gulp-svgstore.

michaelpumo avatar michaelpumo commented on June 15, 2024

I'll try and get an isolated test case over in the next few days. Apologies for the delay.

from gulp-svgstore.

w0rm avatar w0rm commented on June 15, 2024

@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.

michaelpumo avatar michaelpumo commented on June 15, 2024

@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.

w0rm avatar w0rm commented on June 15, 2024

@michaelpumo any way will work, you can even try to attach a zip file here or email it to [email protected]

from gulp-svgstore.

jayjo avatar jayjo commented on June 15, 2024

I'm experiencing this same issue. I've emailed [email protected] with a .zip file of the project.

from gulp-svgstore.

AlexSND avatar AlexSND commented on June 15, 2024

thnx, ramaralo! it's work!

from gulp-svgstore.

var-bin avatar var-bin commented on June 15, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.