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

chore(build): 1.0.1-beta.2 build:prod fails with errors #103

Closed
bitbay opened this issue Jan 28, 2016 · 10 comments
Closed

chore(build): 1.0.1-beta.2 build:prod fails with errors #103

bitbay opened this issue Jan 28, 2016 · 10 comments

Comments

@bitbay
Copy link

bitbay commented Jan 28, 2016

Fresh cloning the latest 1.0.1-beta.2 and running

$ git clone https://github.com/valor-software/ng2-bootstrap.git
$ cd ng2-bootstrap.git
ng2-bootstrap$ npm i
ng2-bootstrap$ npm run build:prod

results the following error and no built/bundled files created:

ng2-bootstrap$ npm run build:prod
> [email protected] build:prod /workspace/github/ng2-bootstrap
> NODE_ENV=production webpack -p --progress --color --optimize-minimize --optimize-dedupe --optimize-occurence-order

clean-webpack-plugin: /workspace/github/ng2-bootstrap/build has been removed.
 54% 6/8 build modulests-loader: Using [email protected] and /workspace/github/ng2-bootstrap/tsconfig.json
 80% optimize chunk assetsTypeError: Invalid non-string/buffer chunk
    at validChunk (_stream_writable.js:178:14)
    at Gzip.Writable.write (_stream_writable.js:205:12)
    at Gzip.Writable.end (_stream_writable.js:433:10)
    at zlibBuffer (zlib.js:197:10)
    at Object.exports.gzip (zlib.js:123:10)
    at CompressionPlugin.<anonymous> (/workspace/github/ng2-bootstrap/node_modules/compression-webpack-plugin/index.js:68:10)
    at /workspace/github/ng2-bootstrap/node_modules/compression-webpack-plugin/node_modules/async/lib/async.js:111:13
    at Array.forEach (native)
    at _each (/workspace/github/ng2-bootstrap/node_modules/compression-webpack-plugin/node_modules/async/lib/async.js:32:24)
    at Object.async.each (/workspace/github/ng2-bootstrap/node_modules/compression-webpack-plugin/node_modules/async/lib/async.js:110:9)
    at CompressionPlugin.<anonymous> (/workspace/github/ng2-bootstrap/node_modules/compression-webpack-plugin/index.js:55:10)
    at Compilation.applyPluginsAsync (/workspace/github/ng2-bootstrap/node_modules/tapable/lib/Tapable.js:71:13)
    at Compilation.<anonymous> (/workspace/github/ng2-bootstrap/node_modules/webpack/lib/Compilation.js:572:10)
    at Compilation.next (/workspace/github/ng2-bootstrap/node_modules/tapable/lib/Tapable.js:67:11)
    at Compilation.<anonymous> (/workspace/github/ng2-bootstrap/node_modules/webpack/lib/optimize/UglifyJsPlugin.js:137:4)
    at Compilation.next (/workspace/github/ng2-bootstrap/node_modules/tapable/lib/Tapable.js:69:14)
    at Compilation.<anonymous> (/workspace/github/ng2-bootstrap/node_modules/webpack/lib/ProgressPlugin.js:65:5)
    at Compilation.next (/workspace/github/ng2-bootstrap/node_modules/tapable/lib/Tapable.js:69:14)
    at Compilation.<anonymous> (/workspace/github/ng2-bootstrap/node_modules/webpack/lib/optimize/UglifyJsPlugin.js:137:4)
    at Compilation.applyPluginsAsync (/workspace/github/ng2-bootstrap/node_modules/tapable/lib/Tapable.js:71:13)
    at Compilation.<anonymous> (/workspace/github/ng2-bootstrap/node_modules/webpack/lib/Compilation.js:567:9)
    at Compilation.applyPluginsAsync (/workspace/github/ng2-bootstrap/node_modules/tapable/lib/Tapable.js:60:69)
    at Compilation.<anonymous> (/workspace/github/ng2-bootstrap/node_modules/webpack/lib/Compilation.js:563:8)
    at Compilation.applyPluginsAsync (/workspace/github/ng2-bootstrap/node_modules/tapable/lib/Tapable.js:60:69)
    at Compilation.seal (/workspace/github/ng2-bootstrap/node_modules/webpack/lib/Compilation.js:525:7)
    at Compiler.<anonymous> (/workspace/github/ng2-bootstrap/node_modules/webpack/lib/Compiler.js:397:15)
    at /workspace/github/ng2-bootstrap/node_modules/tapable/lib/Tapable.js:103:11
    at Compilation.<anonymous> (/workspace/github/ng2-bootstrap/node_modules/webpack/lib/Compilation.js:445:10)
    at /workspace/github/ng2-bootstrap/node_modules/webpack/lib/Compilation.js:417:12
    at /workspace/github/ng2-bootstrap/node_modules/webpack/lib/Compilation.js:332:10

npm ERR! Linux 3.19.0
npm ERR! argv "/opt/nodejs/node-v5.4.0-linux-x64/bin/node" "/opt/nodejs/node/bin/npm" "run" "build:prod"
npm ERR! node v5.4.0
npm ERR! npm  v3.3.12
npm ERR! code ELIFECYCLE
npm ERR! [email protected] build:prod: `NODE_ENV=production webpack -p --progress --color --optimize-minimize --optimize-dedupe --optimize-occurence-order`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] build:prod script 'NODE_ENV=production webpack -p --progress --color --optimize-minimize --optimize-dedupe --optimize-occurence-order'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the ng2-bootstrap package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     NODE_ENV=production webpack -p --progress --color --optimize-minimize --optimize-dedupe --optimize-occurence-order
npm ERR! You can get their info via:
npm ERR!     npm owner ls ng2-bootstrap
npm ERR! There is likely additional logging output above.

I tried running other npm scripts as well:

ng2-bootstrap$ npm run prepublish
> [email protected] prepublish /workspace/github/ng2-bootstrap
> gulp clean && ./node_modules/.bin/tsc && ./make.js

[05:07:48] Using gulpfile /workspace/github/ng2-bootstrap/gulpfile.js
[05:07:48] Starting 'clean'...
[05:07:48] Finished 'clean' after 11 ms
Deleted files and folders:

Bundling system.js file: ng2-bootstrap.js {}
Unhandled rejection Error on fetch for ng2-bootstrap/ng2-bootstrap at file:///workspace/github/ng2-bootstrap/ng2-bootstrap.js
    Error: ENOENT: no such file or directory, open '/workspace/github/ng2-bootstrap/ng2-bootstrap.js'
    at Error (native)

Maybe the build:prod fails because ./make.js is failing?

@bitbay
Copy link
Author

bitbay commented Jan 28, 2016

Ok, right after i found some more clues...
I have the repo cloned into a directory named "/workspace/github/ng2-bootstrap-origin" while the ./build.js is looking for the file "file:///workspace/github/ng2-bootstrap/ng2-bootstrap.js" - it seems that the build script is not context aware/independent?
_edit_
definitely the case for build.js. I tried compiling from ./ng2-bootstrap, and build.js works as expected, but the npm run build:prod still fails as above.

@valorkin
Copy link
Member

@bitbay unfortunately there some problems with webpack prod build
hacks to fix it present in https://github.com/AngularClass/angular2-webpack-starter
so if you can figure it out and fix it here
I will be really greatfull

@bitbay
Copy link
Author

bitbay commented Jan 28, 2016

@valorkin will try #102 first to see if it fixes the problem, and in the meantime i'll try to fix the issue regarding the directory agnostic build (my second reported issue).

@valorkin valorkin changed the title 1.0.1-beta.2 build:prod fails with errors chore(build): 1.0.1-beta.2 build:prod fails with errors Jan 28, 2016
@valorkin
Copy link
Member

@bitbay don't try to solve directory agnostic build, it is did intentionally, details here
systemjs/builder#475

@valorkin
Copy link
Member

and may be upgrading to beta-2 could solve this issue

@bitbay
Copy link
Author

bitbay commented Jan 29, 2016

@valorkin please see #106 for details.
It´s not a pull request to solve this issue (as in the title), but since i already mixed in this conversation another issue with make.js as well, i post the solution here too.

@valorkin
Copy link
Member

Thing is, ./make.js is depends on name of folder where ng2-bootstrap is cloned
but for a reason to achieve parity with tsc imports
without hacks system.js build will registrer ng2-bootrstrap module name
but I need ng2-bootrstrap/ng2-bootrstrap

If you will read an Issue I have mentioned before
@johnpapa and @wardbell are coping a whole project into temporary folder
and bundle it from there
I thinks it is overkill,
IMHO: temporary bind to folder name where to clone (default by the way)
is much simpler solution

anyway with TS 1.8 released I will revisit system.js bundles build process

@valorkin
Copy link
Member

@bitbay and buy the way, Issues you have mentioned is fixed by rollback to v 0.2 CompressionPlugin
here is corresponding issue: webpack-contrib/compression-webpack-plugin#16

@bitbay
Copy link
Author

bitbay commented Jan 29, 2016

awesome! Updating now and give it a try!

edit
works like a charm!

@valorkin
Copy link
Member

thats good :)

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

2 participants