Skip to content
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

Cannot read property 'filter' of undefined #41

Open
ghost opened this issue Apr 9, 2017 · 0 comments
Open

Cannot read property 'filter' of undefined #41

ghost opened this issue Apr 9, 2017 · 0 comments

Comments

@ghost
Copy link

ghost commented Apr 9, 2017

I have install svgo globally using yarn global add svgo and it is available in the command line. However I encounter the following issue when I try to start Ember server.

It is working fine when I disable SVG optimise using snippet below,

module.exports = function(defaults) {
  var app = new EmberApp(defaults, {
    svg: {
      optimize: false
    }
  });
  // ...
}

Snippet Below is the error trace when I using add-on's default configuration.

➜  MemoCycle git:(master) ✗ ember s
Livereload server on http://localhost:49153
Serving on http://localhost:4200/

The Broccoli Plugin: [SVGOptimizer] failed with:
TypeError: Cannot read property 'filter' of undefined
    at monkeys (/Users/li-xinyang/Desktop/MemoCycle/node_modules/svgo/lib/svgo/plugins.js:46:38)
    at perItem (/Users/li-xinyang/Desktop/MemoCycle/node_modules/svgo/lib/svgo/plugins.js:77:12)
    at /Users/li-xinyang/Desktop/MemoCycle/node_modules/svgo/lib/svgo/plugins.js:18:24
    at Array.forEach (native)
    at module.exports (/Users/li-xinyang/Desktop/MemoCycle/node_modules/svgo/lib/svgo/plugins.js:14:13)
    at /Users/li-xinyang/Desktop/MemoCycle/node_modules/svgo/lib/svgo.js:63:17
    at Object.sax.onend (/Users/li-xinyang/Desktop/MemoCycle/node_modules/svgo/lib/svgo/svg2js.js:156:13)
    at emit (/Users/li-xinyang/Desktop/MemoCycle/node_modules/sax/lib/sax.js:640:35)
    at end (/Users/li-xinyang/Desktop/MemoCycle/node_modules/sax/lib/sax.js:683:5)
    at Object.write (/Users/li-xinyang/Desktop/MemoCycle/node_modules/sax/lib/sax.js:991:14)

The broccoli plugin was instantiated at:
    at SVGOptimizer.Plugin (/Users/li-xinyang/Desktop/MemoCycle/node_modules/broccoli-plugin/index.js:7:31)
    at SVGOptimizer.CachingWriter [as constructor] (/Users/li-xinyang/Desktop/MemoCycle/node_modules/ember-inline-svg/node_modules/broccoli-caching-writer/index.js:18:10)
    at new SVGOptimizer (/Users/li-xinyang/Desktop/MemoCycle/node_modules/ember-inline-svg/svg-optimizer.js:18:10)
    at Class.optimizeSVGs (/Users/li-xinyang/Desktop/MemoCycle/node_modules/ember-inline-svg/index.js:41:12)
    at Class.treeForApp (/Users/li-xinyang/Desktop/MemoCycle/node_modules/ember-inline-svg/index.js:53:17)
    at Class._treeFor (/Users/li-xinyang/Desktop/MemoCycle/node_modules/ember-cli/lib/models/addon.js:517:33)
    at Class.treeFor (/Users/li-xinyang/Desktop/MemoCycle/node_modules/ember-cli/lib/models/addon.js:477:21)
    at project.addons.map.addon (/Users/li-xinyang/Desktop/MemoCycle/node_modules/ember-cli/lib/broccoli/ember-app.js:525:20)
    at Array.map (native)
    at EmberApp.addonTreesFor (/Users/li-xinyang/Desktop/MemoCycle/node_modules/ember-cli/lib/broccoli/ember-app.js:523:30)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants