Production Build error


#1

Hi ,

In my project when i create Production Build then this error is occur plz give me suggestion to solve this issue. when i create Development Build then there is no issue . This issue is occur when i ctreate Production Build.

TypeError: Cannot read property ‘length’ of undefined at UglifyWriter.processFile (E:-------\node_modules\broccoli-uglify-sourcemap\index.js:112:67) at E:--------\nod e_modules\broccoli-uglify-sourcemap\index.js:65:16 at Array.forEach () at E:----------\nod e_modules\broccoli-uglify-sourcemap\index.js:55:25 at Array.forEach () at UglifyWriter.build (E:--------\node_modules\broccoli-uglify-sourcemap\index.js:54:19) at E:--------\nod e_modules\broccoli-plugin\read_compat.js:93:34 at tryCatch (E:---------\node_modules\rsvp\dist\rsvp.js:526:12) at invokeCallback (E:--------\node_modules\rsvp\dist\rsvp.js:540:13) at publish (E:--------\node_modules\rsvp\dist\rsvp.js:508:7)

The broccoli plugin was instantiated at: at Fingerprint.Plugin (E:------\node_modules\broccoli-plugin\index.js:7:31) at Fingerprint.Filter [as constructor] (E:-----\node_modules\broccoli-filter\index.js:34:10) at new Fingerprint (E:------\node_modules\broccoli-asset-rev\lib\fingerprint.js:21:10) at Fingerprint (E:-------\node_modules\broccoli-asset-rev\lib\fingerprint.js:16:12) at new AssetRev (E:------\node_modules\broccoli-asset-rev\lib\asset-rev.js:31:25) at AssetRev (E:-------\node_modules\broccoli-asset-rev\lib\asset-rev.js:7:12) at Class.postprocessTree (E:-------\node_modules\broccoli-asset-rev\index.js:31:40) at projectOrAddon.addons.reduce (E:------\node_modules\ember-cli\lib\utilities\addon-process-tr ee.js:6:25) at Array.reduce () at addonProcessTree (E:------\node_modules\ember-cli\lib\utilities\addon-process-tree.js:4:32)


#2

what’s your ember-cli-build.js ?


#3

HI, Kimek Thanks for reply Here is my ember-cli-build.js class plz give me response as soon as possible . Thanks in advance

/* eslint-env node */ ‘use strict’;

const EmberApp = require(‘ember-cli/lib/broccoli/ember-app’);

module.exports = function(defaults) { let app = new EmberApp(defaults, { // Add options here });

app.import(‘vendor/shims/authorize.js’); app.import(‘vendor/shims/cookiemanager.js’); app.import(‘vendor/shims/jquery.cookie.js’); app.import(‘vendor/shims/sha.js’); app.import(‘vendor/shims/commonfunction.js’); app.import(‘vendor/shims/jquery-cron.js’); app.import(‘vendor/shims/jquery-ui.js’);

return app.toTree(); };


#4

In your ember-cli-build.js file, replace new EmberApp(defaults, { // Add options here }) with new EmberApp({ fingerprint: { enabled: false } }).


#5

Hi derpy, thanks for reply As per your guidence i replace new EmberApp({ fingerprint: { enabled: false } }). But same issue after this changes. Production Build error.


#6

Hmmm interesting. Try reinstalling your node modules. Remove your node_modules directory, and then run npm cache clean and then npm install.


#7

After run these commnads same issue.


#8

To resolve this Issue

  1. Run this command ember install ember-cli-uglify

  2. and then in ember-cli-build class module.exports = function(defaults) { let app = new EmberApp(defaults, { // Add options here ’ember-cli-uglify’: { enabled: false }, });

  3. then run ember build --prod

then successfully production build is created.


#9

I can see that you are using E: drive, did it have enough space to run a production build correctly? Depends on your project, free space should be more than 2 or 3 GB.

Best regards.


#10

I have resolved the issue , I had a config.js file containing simple javascript object in public directory and uglify was unable to process that file. I removed the extension from that file and it resolved the issue as uglify looks for js files.