simonihmig / ember-cli-bundle-analyzer

Analyze the size and contents of your Ember app's bundles
MIT License
99 stars 2 forks source link

Cannot read property 'length' of undefined #28

Closed ehubbell closed 4 years ago

ehubbell commented 5 years ago

Hi All,

I'm running into the following issue above when I go to build my project and it appears to be coming from my vendor.css file. Any ideas on how to track this down? The concat-stats-for folder gets created with all the analysis but I can't get ember s to run successfully with version 0.1.0 of this addon.

Here's an ember -v output:

ember-cli: 3.5.1
node: 8.9.4
os: darwin x64

And the error summary:

ERROR Summary:

  - broccoliBuilderErrorStack: TypeError: Cannot read property 'length' of undefined
    at concat.reduce (/Users/erichubbell/Sites/myhub/myhub-web/node_modules/ember-cli/node_modules/broccoli-concat/lib/strategies/simple.js:150:41)
    at Array.reduce (<anonymous>)
    at SimpleConcat.fileSizes (/Users/erichubbell/Sites/myhub/myhub-web/node_modules/ember-cli/node_modules/broccoli-concat/lib/strategies/simple.js:149:7)
    at Concat._doPatchBasedBuild (/Users/erichubbell/Sites/myhub/myhub-web/node_modules/ember-cli/node_modules/broccoli-concat/concat.js:155:35)
    at Concat.build (/Users/erichubbell/Sites/myhub/myhub-web/node_modules/ember-cli/node_modules/broccoli-concat/concat.js:105:19)
    at resolve (/Users/erichubbell/Sites/myhub/myhub-web/node_modules/broccoli/lib/wrappers/transform-node.js:29:35)
    at new Promise (<anonymous>)
    at TransformNodeWrapper.build (/Users/erichubbell/Sites/myhub/myhub-web/node_modules/broccoli/lib/wrappers/transform-node.js:21:12)
    at Promise.resolve.then.then.then (/Users/erichubbell/Sites/myhub/myhub-web/node_modules/broccoli/lib/builder.js:116:28)
    at <anonymous>
  - code: [undefined]
  - codeFrame: Cannot read property 'length' of undefined
  - errorMessage: Cannot read property 'length' of undefined
        at SimpleConcatConcat (Concat: Vendor Styles/assets/vendor.css)
-~- created here: -~-
    at new Plugin (/Users/erichubbell/Sites/myhub/myhub-web/node_modules/broccoli-plugin/index.js:7:31)
    at new Concat (/Users/erichubbell/Sites/myhub/myhub-web/node_modules/ember-cli/node_modules/broccoli-concat/concat.js:29:5)
    at module.exports (/Users/erichubbell/Sites/myhub/myhub-web/node_modules/ember-cli/node_modules/broccoli-concat/index.js:28:10)
    at DefaultPackager.packageStyles (/Users/erichubbell/Sites/myhub/myhub-web/node_modules/ember-cli/lib/broccoli/default-packager.js:612:27)
    at EmberApp._legacyPackage (/Users/erichubbell/Sites/myhub/myhub-web/node_modules/ember-cli/lib/broccoli/ember-app.js:1715:44)
    at EmberApp.toTree (/Users/erichubbell/Sites/myhub/myhub-web/node_modules/ember-cli/lib/broccoli/ember-app.js:1766:27)
    at module.exports (/Users/erichubbell/Sites/myhub/myhub-web/ember-cli-build.js:30:14)
    at Builder.readBuildFile (/Users/erichubbell/Sites/myhub/myhub-web/node_modules/ember-cli/lib/models/builder.js:52:14)
    at Builder.setupBroccoliBuilder (/Users/erichubbell/Sites/myhub/myhub-web/node_modules/ember-cli/lib/models/builder.js:66:22)
    at new Builder (/Users/erichubbell/Sites/myhub/myhub-web/node_modules/ember-cli/lib/models/builder.js:32:10)
-~- (end) -~-
  - errorType: Build Error
  - location:
    - column: [undefined]
    - file: [undefined]
    - line: [undefined]
    - treeDir: [undefined]
  - message: Cannot read property 'length' of undefined
        at SimpleConcatConcat (Concat: Vendor Styles/assets/vendor.css)
-~- created here: -~-
    at new Plugin (/Users/erichubbell/Sites/myhub/myhub-web/node_modules/broccoli-plugin/index.js:7:31)
    at new Concat (/Users/erichubbell/Sites/myhub/myhub-web/node_modules/ember-cli/node_modules/broccoli-concat/concat.js:29:5)
    at module.exports (/Users/erichubbell/Sites/myhub/myhub-web/node_modules/ember-cli/node_modules/broccoli-concat/index.js:28:10)
    at DefaultPackager.packageStyles (/Users/erichubbell/Sites/myhub/myhub-web/node_modules/ember-cli/lib/broccoli/default-packager.js:612:27)
    at EmberApp._legacyPackage (/Users/erichubbell/Sites/myhub/myhub-web/node_modules/ember-cli/lib/broccoli/ember-app.js:1715:44)
    at EmberApp.toTree (/Users/erichubbell/Sites/myhub/myhub-web/node_modules/ember-cli/lib/broccoli/ember-app.js:1766:27)
    at module.exports (/Users/erichubbell/Sites/myhub/myhub-web/ember-cli-build.js:30:14)
    at Builder.readBuildFile (/Users/erichubbell/Sites/myhub/myhub-web/node_modules/ember-cli/lib/models/builder.js:52:14)
    at Builder.setupBroccoliBuilder (/Users/erichubbell/Sites/myhub/myhub-web/node_modules/ember-cli/lib/models/builder.js:66:22)
    at new Builder (/Users/erichubbell/Sites/myhub/myhub-web/node_modules/ember-cli/lib/models/builder.js:32:10)
-~- (end) -~-
  - name: BuildError
  - nodeAnnotation: Concat: Vendor Styles/assets/vendor.css
  - nodeName: SimpleConcatConcat
  - originalErrorMessage: Cannot read property 'length' of undefined
  - stack: TypeError: Cannot read property 'length' of undefined
    at concat.reduce (/Users/erichubbell/Sites/myhub/myhub-web/node_modules/ember-cli/node_modules/broccoli-concat/lib/strategies/simple.js:150:41)
    at Array.reduce (<anonymous>)
    at SimpleConcat.fileSizes (/Users/erichubbell/Sites/myhub/myhub-web/node_modules/ember-cli/node_modules/broccoli-concat/lib/strategies/simple.js:149:7)
    at Concat._doPatchBasedBuild (/Users/erichubbell/Sites/myhub/myhub-web/node_modules/ember-cli/node_modules/broccoli-concat/concat.js:155:35)
    at Concat.build (/Users/erichubbell/Sites/myhub/myhub-web/node_modules/ember-cli/node_modules/broccoli-concat/concat.js:105:19)
    at resolve (/Users/erichubbell/Sites/myhub/myhub-web/node_modules/broccoli/lib/wrappers/transform-node.js:29:35)
    at new Promise (<anonymous>)
    at TransformNodeWrapper.build (/Users/erichubbell/Sites/myhub/myhub-web/node_modules/broccoli/lib/wrappers/transform-node.js:21:12)
    at Promise.resolve.then.then.then (/Users/erichubbell/Sites/myhub/myhub-web/node_modules/broccoli/lib/builder.js:116:28)
    at <anonymous>
simonihmig commented 5 years ago

Hm, any reproduction you could share?

It seems the stack trace points to this line where the error is thrown: https://github.com/broccolijs/broccoli-concat/blob/master/lib/strategies/simple.js#L150. So I think you should open an issue in the broccoli-concat repo!