Closed schuylr closed 7 years ago
@schuylr Could you please downgrade webpack to 2.x stable version and deploy again? Seems like some of the dependencies are yet to be upgraded to 3.0.0
That fixed some dependencies. fsevents@1.1.2
is still an issue and that warning breaks things, along with the "no license field" warning:
(Backtrace restricted to imported tasks)
cap aborted!
SSHKit::Runner::ExecuteError: Exception while executing as deploy@securedev.jewlr.com: rake exit status: 1
rake stdout: yarn install v0.24.6
[1/4] Resolving packages...
[2/4] Fetching packages...
info "fsevents@1.1.2" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Saved lockfile.
Done in 16.98s.
Webpacker is installed 🎉 🍰
Using /var/www/apps/jewlrorders/releases/20170622173337/config/webpacker.yml file for setting up webpack paths
[Webpacker] Compiling assets 🎉
rake stderr: warning No license field
warning fsevents@1.1.2: The platform "linux" is incompatible with this module.
error Command failed with exit code 2.
SSHKit::Command::Failed: rake exit status: 1
rake stdout: yarn install v0.24.6
[1/4] Resolving packages...
[2/4] Fetching packages...
info "fsevents@1.1.2" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Saved lockfile.
Done in 16.98s.
Webpacker is installed 🎉 🍰
Using /var/www/apps/jewlrorders/releases/20170622173337/config/webpacker.yml file for setting up webpack paths
[Webpacker] Compiling assets 🎉
rake stderr: warning No license field
warning fsevents@1.1.2: The platform "linux" is incompatible with this module.
error Command failed with exit code 2.
Tasks: TOP => deploy:assets:precompile
(See full trace by running task with --trace)
The deploy has failed with an error: Exception while executing as deploy@securedev.jewlr.com: rake exit status: 1
rake stdout: yarn install v0.24.6
[1/4] Resolving packages...
[2/4] Fetching packages...
info "fsevents@1.1.2" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Saved lockfile.
Done in 16.98s.
Webpacker is installed 🎉 🍰
Using /var/www/apps/jewlrorders/releases/20170622173337/config/webpacker.yml file for setting up webpack paths
[Webpacker] Compiling assets 🎉
rake stderr: warning No license field
warning fsevents@1.1.2: The platform "linux" is incompatible with this module.
error Command failed with exit code 2.
Warnings shouldn't be returning non-zero codes :(
@schuylr Yes, this is strange - it shouldn't fail for warnings. I will investigate and post something here.
So I ssh'ed directly into the server and ran the bin/rake assests:precompile
and found this:
deploy@jewlr-dev_devorders_1:/var/www/apps/jewlrorders/releases/20170623132838$ bin/rake assets:precompile
yarn install v0.24.6
[1/4] Resolving packages...
success Already up-to-date.
Done in 0.71s.
Webpacker is installed 🎉 🍰
Using /var/www/apps/jewlrorders/releases/20170623132838/config/webpacker.yml file for setting up webpack paths
[Webpacker] Compiling assets 🎉
[Webpacker] Compilation Failed
yarn run v0.24.6
$ "/var/www/apps/jewlrorders/releases/20170623132838/node_modules/.bin/webpack" --config /var/www/apps/jewlrorders/releases/20170623132838/config/webpack/production.js
Hash: 7edd04f4110a98bf249b
Time: 33350ms
[9] ./~/paper/dist/paper-full.js 427 kB {0} {1} {3} {4} {5} {6} {7} {8} [built]
[15] ./app/javascript/packs/nameplate-tool/internals/history.js 1.56 kB {0} {1} {3} {4} {5} {6} {8} [built]
[74] ./app/javascript/packs/nameplate-tool/bindings.js 11.1 kB {0} {1} {3} {6} [built]
[75] ./app/javascript/packs/nameplate-tool/internals/name-drawer.js 8.44 kB {0} {1} {3} {4} [built]
[76] ./~/opentype.js/src/opentype.js 14.2 kB {0} {1} {3} {4} [built]
[77] ./~/prop-types/index.js 1.08 kB {0} {1} {2} [built]
[78] ./~/react-dom/index.js 59 bytes {0} {1} {2} [built]
[79] ./~/react/react.js 56 bytes {0} {1} {2} [built]
[128] ./app/javascript/packs/nameplate-tool/tools/direct-selection.js 7.34 kB {0} {1} {3} [built]
[129] ./app/javascript/packs/nameplate-tool/tools/pen.js 9.77 kB {0} {1} {5} [built]
[130] ./app/javascript/packs/nameplate-tool/tools/shape.js 195 bytes {0} {1} {7} [built]
[222] ./app/javascript/packs/nameplate-tool.jsx 8.95 kB {0} {1} [built]
[223] ./app/javascript/packs/hello_react.jsx 739 bytes {2} [built]
[224] ./app/javascript/packs/nameplate-prepper.jsx 385 bytes {0} [built]
[225] ./app/javascript/packs/application.js 515 bytes {9} [built]
+ 211 hidden modules
ERROR in nameplate-prepper-799e474389e0fb9974c5.js from UglifyJs
Unexpected token: name (tag) [./~/opentype.js/src/parse.js:39,0][nameplate-prepper-799e474389e0fb9974c5.js:291,8]
ERROR in nameplate-tool-c04f0ea495e92e1a0ab4.js from UglifyJs
Unexpected token: name (tag) [./~/opentype.js/src/parse.js:39,0][nameplate-tool-c04f0ea495e92e1a0ab4.js:291,8]
ERROR in nameplate-tool/tools/direct-selection-75adf6f132855103cd8c.js from UglifyJs
Unexpected token: name (tag) [./~/opentype.js/src/parse.js:39,0][nameplate-tool/tools/direct-selection-75adf6f132855103cd8c.js:117,8]
ERROR in nameplate-tool/internals/name-drawer-8165e65fb379cd0c5ad5.js from UglifyJs
Unexpected token: name (tag) [./~/opentype.js/src/parse.js:39,0][nameplate-tool/internals/name-drawer-8165e65fb379cd0c5ad5.js:117,8]
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 2.
So I have to fix something with my code (maybe). However, this should be visible from Capistrano's side, and I never saw this while deploying.
Looks like it's es6 code from nameplate-prepper
. Do you have uglify: true
in .babelrc
?
@gauravtiwari No, it's coming from opentype.js
, here's the line:
let tag = '';
Why doesn't Babel transpile the ES6 code into something usable for Uglify...?
I tried using uglify: false
in my .babelrc
and still have the same problem:
deploy@jewlr-dev_devorders_1:/var/www/apps/jewlrorders/releases/20170623134427$ bin/rake assets:precompile
yarn install v0.24.6
[1/4] Resolving packages...
success Already up-to-date.
Done in 0.65s.
Webpacker is installed 🎉 🍰
Using /var/www/apps/jewlrorders/releases/20170623134427/config/webpacker.yml file for setting up webpack paths
[Webpacker] Compiling assets 🎉
[Webpacker] Compilation Failed
yarn run v0.24.6
$ "/var/www/apps/jewlrorders/releases/20170623134427/node_modules/.bin/webpack" --config /var/www/apps/jewlrorders/releases/20170623134427/config/webpack/production.js
Hash: a19d83584b47a5908ad2
Time: 34609ms
[9] ./~/paper/dist/paper-full.js 427 kB {0} {1} {3} {4} {5} {6} {7} {8} [built]
[15] ./app/javascript/packs/nameplate-tool/internals/history.js 1.56 kB {0} {1} {3} {4} {5} {6} {8} [built]
[74] ./app/javascript/packs/nameplate-tool/bindings.js 11.1 kB {0} {1} {3} {6} [built]
[75] ./app/javascript/packs/nameplate-tool/internals/name-drawer.js 8.47 kB {0} {1} {3} {4} [built]
[76] ./~/opentype.js/src/opentype.js 14.2 kB {0} {1} {3} {4} [built]
[77] ./~/prop-types/index.js 1.08 kB {0} {1} {2} [built]
[78] ./~/react-dom/index.js 59 bytes {0} {1} {2} [built]
[79] ./~/react/react.js 56 bytes {0} {1} {2} [built]
[128] ./app/javascript/packs/nameplate-tool/tools/direct-selection.js 8.37 kB {0} {1} {3} [built]
[129] ./app/javascript/packs/nameplate-tool/tools/pen.js 9.77 kB {0} {1} {5} [built]
[130] ./app/javascript/packs/nameplate-tool/tools/shape.js 195 bytes {0} {1} {7} [built]
[222] ./app/javascript/packs/nameplate-tool.jsx 9.83 kB {0} {1} [built]
[223] ./app/javascript/packs/hello_react.jsx 739 bytes {2} [built]
[224] ./app/javascript/packs/nameplate-prepper.jsx 385 bytes {0} [built]
[225] ./app/javascript/packs/application.js 515 bytes {9} [built]
+ 211 hidden modules
ERROR in nameplate-prepper-cbb8752a7c18b1347912.js from UglifyJs
Unexpected token: name (tag) [./~/opentype.js/src/parse.js:39,0][nameplate-prepper-cbb8752a7c18b1347912.js:291,8]
ERROR in nameplate-tool-cd2da9a25443f6f11bac.js from UglifyJs
Unexpected token: name (tag) [./~/opentype.js/src/parse.js:39,0][nameplate-tool-cd2da9a25443f6f11bac.js:291,8]
ERROR in nameplate-tool/tools/direct-selection-b2cefb188243fdc1516c.js from UglifyJs
Unexpected token: name (tag) [./~/opentype.js/src/parse.js:39,0][nameplate-tool/tools/direct-selection-b2cefb188243fdc1516c.js:117,8]
ERROR in nameplate-tool/internals/name-drawer-6aa26d490cab29a177e9.js from UglifyJs
Unexpected token: name (tag) [./~/opentype.js/src/parse.js:39,0][nameplate-tool/internals/name-drawer-6aa26d490cab29a177e9.js:117,8]
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 2.
deploy@jewlr-dev_devorders_1:/var/www/apps/jewlrorders/releases/20170623134427$ cat .babelrc
{
"presets": [
[
"env",
{
"modules": false,
"targets": {
"browsers": "> 1%",
"uglify": false
},
"useBuiltIns": true
}
],
"react"
],
"plugins": [
"syntax-dynamic-import",
[
"transform-class-properties",
{
"spec": true
}
]
]
}
Oh that should be true to compile everything to es5, but seems one of the packages you are using got es6 syntax.
Could you take a look at this issue please? https://github.com/rails/webpacker/issues/395 - particularly this comment https://github.com/rails/webpacker/issues/395#issuecomment-304044400
See my latest attempt with that issue and comments in mind:
deploy@jewlr-dev_devorders_1:/var/www/apps/jewlrorders/releases/20170623134427$ bin/rake assets:precompile
yarn install v0.24.6
[1/4] Resolving packages...
success Already up-to-date.
Done in 0.63s.
Webpacker is installed 🎉 🍰
Using /var/www/apps/jewlrorders/releases/20170623134427/config/webpacker.yml file for setting up webpack paths
[Webpacker] Compiling assets 🎉
[Webpacker] Compilation Failed
yarn run v0.24.6
$ "/var/www/apps/jewlrorders/releases/20170623134427/node_modules/.bin/webpack" --config /var/www/apps/jewlrorders/releases/20170623134427/config/webpack/production.js
Hash: cf3c3e0b20c7d73d34d7
Time: 32782ms
[9] ./~/paper/dist/paper-full.js 427 kB {0} {1} {3} {4} {5} {6} {7} {8} [built]
[15] ./app/javascript/packs/nameplate-tool/internals/history.js 1.53 kB {0} {1} {3} {4} {5} {6} {8} [built]
[74] ./app/javascript/packs/nameplate-tool/bindings.js 11.1 kB {0} {1} {3} {6} [built]
[75] ./app/javascript/packs/nameplate-tool/internals/name-drawer.js 8.44 kB {0} {1} {3} {4} [built]
[76] ./~/opentype.js/src/opentype.js 14.2 kB {0} {1} {3} {4} [built]
[77] ./~/prop-types/index.js 1.08 kB {0} {1} {2} [built]
[78] ./~/react-dom/index.js 59 bytes {0} {1} {2} [built]
[79] ./~/react/react.js 56 bytes {0} {1} {2} [built]
[128] ./app/javascript/packs/nameplate-tool/tools/direct-selection.js 8.37 kB {0} {1} {3} [built]
[129] ./app/javascript/packs/nameplate-tool/tools/pen.js 9.77 kB {0} {1} {5} [built]
[130] ./app/javascript/packs/nameplate-tool/tools/shape.js 195 bytes {0} {1} {7} [built]
[222] ./app/javascript/packs/nameplate-tool.jsx 9.83 kB {0} {1} [built]
[223] ./app/javascript/packs/application.js 515 bytes {9} [built]
[224] ./app/javascript/packs/hello_react.jsx 739 bytes {2} [built]
[225] ./app/javascript/packs/nameplate-prepper.jsx 385 bytes {0} [built]
+ 211 hidden modules
ERROR in nameplate-prepper-c11dfa27fa34b9c74017.js from UglifyJs
Unexpected token: name (tag) [./~/opentype.js/src/parse.js:39,0][nameplate-prepper-c11dfa27fa34b9c74017.js:291,8]
ERROR in nameplate-tool-dae98011eb2890bdd2dc.js from UglifyJs
Unexpected token: name (tag) [./~/opentype.js/src/parse.js:39,0][nameplate-tool-dae98011eb2890bdd2dc.js:291,8]
ERROR in nameplate-tool/tools/direct-selection-1ec571bb230394dc0bd0.js from UglifyJs
Unexpected token: name (tag) [./~/opentype.js/src/parse.js:39,0][nameplate-tool/tools/direct-selection-1ec571bb230394dc0bd0.js:117,8]
ERROR in nameplate-tool/internals/name-drawer-2df22d128443df191d56.js from UglifyJs
Unexpected token: name (tag) [./~/opentype.js/src/parse.js:39,0][nameplate-tool/internals/name-drawer-2df22d128443df191d56.js:117,8]
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 2.
deploy@jewlr-dev_devorders_1:/var/www/apps/jewlrorders/releases/20170623134427$ cat .babelrc
{
"presets": [
[
"env",
{
"modules": false,
"targets": {
"browsers": "> 1%"
},
"useBuiltIns": true
}
],
"react"
],
"plugins": [
"syntax-dynamic-import",
[
"transform-class-properties",
{
"spec": true
}
]
]
}
deploy@jewlr-dev_devorders_1:/var/www/apps/jewlrorders/releases/20170623134427$ cat config/webpack/loaders/babel.js
module.exports = {
test: /\.js(\.erb)?$/,
exclude: /node_modules/,
loader: 'babel-loader',
include: ['opentype.js']
}
Okay so I followed the babili
suggestion instead which seems to work.
Would you mind leaving this issue open? Precompile failures should be verbose in the context of Capistrano/Ansible/Heroku deploys and shouldn't be silent as it currently stands.
@schuylr You may wanna look at #533 for some pointers. Agree, will push something to make errors/warnings verbose during compilation.
@schuylr You don't get error messages like this when you deploy -
@gauravtiwari I do not - the pastes you see above are the only things I see from Capistrano when deploying with errors. Are you showing me a Capistrano log?
No this is Heroku actually. Probably something to do with capistrano setup?
If a precompile fails from the old uglifier
gem for example, I get full details and a stack trace. Capistrano used to show everything from stdout
(or puts
from whatever Rake task is running on the remote server through Capistrano) but thanks to an update to sshkit,
error output seems to be doing stupid things. This hasn't been a problem since most gems report to stderr
correctly until now.
Face with the same issue. My workaround:
If you still got an error like
error Command failed with exit code 2.
It might means that some dependencies was not properly resolved like you import something wrong to figure out what really happens. execute on server
RAILS_ENV bundle exec rake assets:precompile
You will see full log.
I think in case of capistrano task it will be better to output all info from webpack, because it takes time from me to figure out that issue was not with packages but with my wrong import (on dev server I've not this issue). Hope it helps to someone.
My deploy precompile seems to work fine however it looks like deprecation/dependency warnings are throwing non-zero exit codes, which makes Capistrano think that the precompile failed:
Is there something I'm missing?