-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Compiles fail with no output #395
Comments
@schneems Yepp, I have seen it before and most probably it's related to One more thing I noticed and mentioned in (#169 (comment)) was that with regular ruby buildpack "scripts": {
"postinstall": "npm rebuild node-sass"
} I think this is a bug we need to fix for compile task. Currently we are using a non-standard way to get output from webpack compile task, which is unhelpful for debugging. I started adding js scripts in #264. Perhaps, I can just make a PR with only scripts so it improves the debugging workflow. |
@ytbryan I'm using Rails 5.1.1 (5.1.0 didn't work either), webpacker latest master branch, ruby buildpack v160. |
Now precompiling is failing every single time regardless of cache state, including the exact code I was using the other week in a brand new dokku app. * scratches head * Precompiling locally in production mode works flawlessly. |
Update: Adding "postinstall": "npm rebuild node-sass" to my I no longer need to clear the cache before every deploy. |
Can you say more here? What could this buy users of webpacker on Heroku? |
@schneems at the moment if the users need to use npm for anything for ex - BTW, fixed the debugging issue on master so, now compile task will provide much better debug output if Ref- #403 |
I am still getting the same error as the original author, with exactly the same stack trace, even after running the I am running Ruby 2.3.1 with Rails 5.1.0 and Webpacker 1.2. Thanks. |
@ThisIsErik try running
|
@flybayer It's complaining that I don't have
|
@ThisIsErik do you have |
As opposed to what? |
As opposed to a dev dependency. So you need in your "dependencies": {
"babel-plugin-transform-object-rest-spread": "^6.23.0",
"..."
},
"devDependencies": {
"..."
}, instead of this: "dependencies": {
"..."
},
"devDependencies": {
"babel-plugin-transform-object-rest-spread": "^6.23.0",
"..."
}, |
@flybayer That solved one problem, but Uglify is throwing more errors. These are not syntax errors, as I have checked.
|
I guess you are not using latest {
"presets": [
["env", {
"modules": false,
"targets": {
"browsers": "> 1%",
"uglify": true
},
"useBuiltIns": true
}]
]
}
|
@gauravtiwari This is my {
"presets": [
["env", {
"modules": false,
"targets": {
"node": "current",
"browsers": "> 1%",
"uglify": true
},
"useBuiltIns": true
}], "react",
],
"plugins": [
"transform-object-rest-spread"
]
} |
@ThisIsErik can you post your entire |
@flybayer Sure! Here you go... {
"dependencies": {
"animated-scroll-to": "^1.0.1",
"autoprefixer": "^7.1.1",
"axios": "^0.16.1",
"babel-core": "^6.24.1",
"babel-loader": "7.x",
"babel-plugin-transform-object-rest-spread": "^6.23.0",
"babel-polyfill": "^6.23.0",
"babel-preset-env": "^1.5.1",
"babel-preset-react": "^6.23.0",
"bootstrap": "^4.0.0-alpha.6",
"classnames": "^2.2.5",
"coffee-loader": "^0.7.3",
"coffee-script": "^1.12.6",
"compression-webpack-plugin": "^0.4.0",
"css-loader": "^0.28.2",
"extract-text-webpack-plugin": "^2.1.0",
"file-loader": "^0.11.1",
"font-awesome": "^4.7.0",
"glob": "^7.1.2",
"halogen": "^0.2.0",
"js-yaml": "^3.8.4",
"moment": "^2.18.1",
"node-sass": "^4.5.3",
"npm": "^4.6.1",
"octicons": "^5.0.1",
"parse-link-header": "^1.0.0",
"path-complete-extname": "^0.1.0",
"postcss-loader": "^2.0.5",
"postcss-smart-import": "^0.7.2",
"precss": "^1.4.0",
"prop-types": "^15.5.8",
"rails-erb-loader": "^5.0.1",
"react": "^15.4.2",
"react-addons-css-transition-group": "^15.4.2",
"react-addons-shallow-compare": "^15.5.1",
"react-addons-transition-group": "^15.4.2",
"react-dates": "^10.0.0",
"react-dom": "^15.4.2",
"react-octicon": "^2.0.0",
"react-octicons-svg": "^1.1.13",
"react-redux": "^5.0.4",
"react-router-dom": "^4.0.0",
"react-router-redux": "^5.0.0-alpha.6",
"react-stripe-checkout": "^2.2.5",
"reactstrap": "^4.4.0",
"redux": "^3.6.0",
"redux-logger": "^3.0.1",
"redux-persist": "^4.0.0-beta1.2",
"redux-thunk": "^2.2.0",
"resolve-url-loader": "^2.0.2",
"sass-loader": "^6.0.5",
"style-loader": "^0.18.1",
"webpack": "^2.6.0",
"webpack-manifest-plugin": "^1.1.0",
"webpack-merge": "^4.1.0"
},
"devDependencies": {
"webpack-dev-server": "^2.4.5"
}
} |
Not sure if |
Closing in favour of #403, which addresses this issue 👍 |
I'm still getting this error, Rails 5.1 and webpacker 2.0. It's definitely something to do with UglifyJs. If I comment out this section of production.js, "compiling webpacker assets" succeeds on Heroku:
|
@cgs Are you using latest |
.babelrc:
From stack trace:
Looks like UglifyJs is not understanding new syntax. Not sure what the fix would be for this |
Are you using typescript - just to confirm? |
Nope just ES2015. It's choking on this file: https://github.com/rigor789/vue-scrollto/blob/master/src/scrollTo.js |
Ahh I see. May be this is related to Please could you add {
test: /\.vue$/,
// .. rest of the config
include: ['vue-scrollto']
} Looks like vue-scrollto is using ES6 and since babel-loader is excluding |
👍 That fixed it. What about vue-scrollto was causing this issue? Oops, sorry, premature reply. I forgot to uncomment the uglifyjs bit. Still failing with the same error. |
@gauravtiwari Would I remove |
@gauravtiwari As such? {
"presets": [
["env", {
"modules": false,
"targets": {
"browsers": "> 1%",
},
"useBuiltIns": true
}],
"react",
],
"plugins": [
"transform-object-rest-spread"
]
} |
Yes please - everything related to uglify must go |
If you are feeling fancy you can give // production.js
devtool: 'source-map',
plugins: [
new PrepackWebpackPlugin({ sourceMaps: true }),
new BabiliPlugin(),
new CompressionPlugin({
asset: '[path].gz[query]',
algorithm: 'gzip',
test: /\.(js|css|html|json|ico|svg|eot|otf|ttf)$/
})
] Note: |
@gauravtiwari That did the trick! Thanks. Here is the contents of the my files that got the deploy to work after running /* .babelrc */
{
"presets": [
["env", {
"modules": false,
"targets": {
"uglify": true, /* remove */
"browsers": "> 1%",
},
"useBuiltIns": true
}],
"react",
],
"plugins": [
"transform-object-rest-spread",
"babili"
]
} /* production.js */
/* eslint global-require: 0 */
// Note: You must run bin/webpack for changes to take effect
const webpack = require('webpack')
const merge = require('webpack-merge')
const CompressionPlugin = require('compression-webpack-plugin')
const sharedConfig = require('./shared.js')
module.exports = merge(sharedConfig, {
output: { filename: '[name]-[chunkhash].js' },
plugins: [
// new webpack.optimize.UglifyJsPlugin(),
new CompressionPlugin({
asset: '[path].gz[query]',
algorithm: 'gzip',
test: /\.(js|css|svg|eot|ttf|woff|woff2)$/
})
]
}) /* package.json */
{
"dependencies": {
"animated-scroll-to": "^1.0.1",
"autoprefixer": "^7.1.1",
"axios": "^0.16.1",
"babel-core": "^6.24.1",
"babel-loader": "7.x",
"babel-plugin-transform-object-rest-spread": "^6.23.0",
"babel-polyfill": "^6.23.0",
"babel-preset-babili": "^0.1.2",
"babel-preset-env": "^1.5.1",
"babel-preset-react": "^6.23.0",
"babili": "^0.1.2",
"bootstrap": "^4.0.0-alpha.6",
"classnames": "^2.2.5",
"coffee-loader": "^0.7.3",
"coffee-script": "^1.12.6",
"compression-webpack-plugin": "^0.4.0",
"css-loader": "^0.28.2",
"extract-text-webpack-plugin": "^2.1.0",
"file-loader": "^0.11.1",
"font-awesome": "^4.7.0",
"glob": "^7.1.2",
"halogen": "^0.2.0",
"js-yaml": "^3.8.4",
"moment": "^2.18.1",
"node-sass": "^4.5.3",
"npm": "^4.6.1",
"octicons": "^5.0.1",
"parse-link-header": "^1.0.0",
"path-complete-extname": "^0.1.0",
"postcss-loader": "^2.0.5",
"postcss-smart-import": "^0.7.2",
"precss": "^1.4.0",
"prop-types": "^15.5.8",
"rails-erb-loader": "^5.0.1",
"react": "^15.4.2",
"react-addons-css-transition-group": "^15.4.2",
"react-addons-shallow-compare": "^15.5.1",
"react-addons-transition-group": "^15.4.2",
"react-dates": "^10.0.0",
"react-dom": "^15.4.2",
"react-octicon": "^2.0.0",
"react-octicons-svg": "^1.1.13",
"react-redux": "^5.0.4",
"react-router-dom": "^4.0.0",
"react-router-redux": "^5.0.0-alpha.6",
"react-stripe-checkout": "^2.2.5",
"reactstrap": "^4.4.0",
"redux": "^3.6.0",
"redux-logger": "^3.0.1",
"redux-persist": "^4.0.0-beta1.2",
"redux-thunk": "^2.2.0",
"resolve-url-loader": "^2.0.2",
"sass-loader": "^6.0.5",
"style-loader": "^0.18.1",
"uglify-js": "^3.0.13",
"webpack": "^2.6.0",
"webpack-manifest-plugin": "^1.1.0",
"webpack-merge": "^4.1.0"
},
"devDependencies": {
"webpack-dev-server": "^2.4.5"
}
}
|
@ThisIsErik |
Hi there, I am also having an issue, with deploying using capistrano
This is my
and
Rails 5.1.1 and Node 6.9.1 Any hint where to look up for the issue? |
Which webpacker version are you using? |
From
And from
|
And there is nothing in the log why it failed? Any error message? Anything after |
Nope, just that.. |
Executing webpack on my machine went fine.. I installed node 6.10.3, yarn 0.24.5,... its Ubuntu 16.04 |
"scripts": {
"postinstall": "npm rebuild node-sass"
} Could you add this to your Strange that you don't get any error output. |
Hey @gauravtiwari , now I'm getting following error
|
@bajalovic I've had that killed error before. The problem was not enough system resources. Restart your server and try again. Maybe stop any other running apps as well. If it still fails, upgrade your server. |
@flybayer I got new droplet on DigitalOcean, with 512MB Ram/1 CPU, 20GB SSD.. This is too small for compiling? |
@bajalovic yeah, it could be. Node takes a LOT of memory. You can run the |
thanks @flybayer, memory was the issue here. I increased instance, and it worked. I also measured while compiling, it took up to ~800mb of ram... |
I am getting similar issues and have tried related things in this thread. I have been purging my cache and verything compiles fine when running locally
Is there anyway to find where the error is? |
@shaun965 In |
This is hopefully a temporary fix, as the stock rails/webpacker config using Uglifyjs is not able to compile code that is ES6. Relevant issues: rails/webpacker#395 (comment) rails/webpacker#531
ran yarn add babel-preset-babili per issue https://github.com/rails/webpacker/issues/395\#issuecomment-304044400
It was a memory issue for me as well |
Failed with no output:
|
From heroku/heroku-buildpack-ruby#562
I'm getting a non-trivial number of people getting compile failures, but with no debug output of any kind. Here's an example:
Is there anything else we can do when this happens? Any way to add debug info? Maybe toggle an environment variable for extra logging?
Have you seen silent failures like this before? Any ideas?
The text was updated successfully, but these errors were encountered: