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

Production deploy, assets.json not found [Epic 2] #751

Closed
jordanh opened this issue Feb 27, 2017 · 7 comments
Closed

Production deploy, assets.json not found [Epic 2] #751

jordanh opened this issue Feb 27, 2017 · 7 comments

Comments

@jordanh
Copy link
Contributor

jordanh commented Feb 27, 2017

Issue - Bug

Getting closer!

One more issue preventing us from starting up. It looks like assets.json is not being created:

2017-02-27T03:10:56.074692905Z app[web.1]: Error: Cannot find module '../../build/assets.json'
2017-02-27T03:10:56.074749004Z app[web.1]:     at Function.Module._resolveFilename (module.js:470:15)
2017-02-27T03:10:56.074757907Z app[web.1]:     at Function.Module._load (module.js:418:25)
2017-02-27T03:10:56.074764924Z app[web.1]:     at Module.require (module.js:498:17)
2017-02-27T03:10:56.074771272Z app[web.1]:     at require (internal/module.js:20:19)
2017-02-27T03:10:56.074776644Z app[web.1]:     at createSSR (/app/src/server/createSSR.js:25:20)
2017-02-27T03:10:56.074782564Z app[web.1]:     at Layer.handle [as handle_request] (/app/node_modules/express/lib/router/layer.js:95:5)
2017-02-27T03:10:56.074807494Z app[web.1]:     at next (/app/node_modules/express/lib/router/route.js:131:13)
  • OS: Linux
@jordanh
Copy link
Contributor Author

jordanh commented Feb 27, 2017

Hmm, it looks like none of the actual build files ended up on the server. I'm looking into it.

@jordanh
Copy link
Contributor Author

jordanh commented Feb 27, 2017

Ah yes, UglifyJs is giving us the sads now:

> parabol-action@0.16.0 build:client-deploy /home/ubuntu/action
> NODE_ENV=production WEBPACK_DEPLOY=true WEBPACK_MIN=true webpack --config ./webpack/prod.babel.js

Executing pre-build scripts
acquired ./build/appTheme.json.lock, creating ./build/appTheme.json...
released ./build/appTheme.json.lock.
Hash: 8183a8818cfdc8b11504
Version: webpack 2.2.0
Time: 29719ms
[../node_modules/auth0-lock/index.js] ../~/auth0-lock/index.js 39.6 kB {11} [built]
[../node_modules/babel-polyfill/lib/index.js] ../~/babel-polyfill/lib/index.js 833 bytes {10} [built]
[../node_modules/react-dom/index.js] ../~/react-dom/index.js 59 bytes {11} [built]
[../node_modules/react-dom/lib/ReactDOM.js] ../~/react-dom/lib/ReactDOM.js 5.14 kB {11} [built]
[../node_modules/react-redux/lib/index.js] ../~/react-redux/lib/index.js 475 bytes {11} [built]
[../node_modules/react-router/lib/IndexRoute.js] ../~/react-router/lib/IndexRoute.js 1.78 kB {11} [built]
[../node_modules/react-router/lib/Lifecycle.js] ../~/react-router/lib/Lifecycle.js 2.73 kB {11} [built]
[../node_modules/react-router/lib/Link.js] ../~/react-router/lib/Link.js 5.63 kB {11} [built]
[../node_modules/react-router/lib/index.js] ../~/react-router/lib/index.js 4.6 kB {11} [built]
[../node_modules/react/react.js] ../~/react/react.js 56 bytes {11} [built]
   [0] multi auth0-lock react react-dom react-redux react-router redux redux-thunk 100 bytes {11} [built]
   [1] multi babel-polyfill client/webpackEntry.js 40 bytes {10} [built]
[../node_modules/redux-thunk/lib/index.js] ../~/redux-thunk/lib/index.js 529 bytes {11} [built]
[../node_modules/redux/es/index.js] ../~/redux/es/index.js 1.08 kB {11} [built]
[./client/webpackEntry.js] ./client/webpackEntry.js 608 bytes {10} [built]
    + 1981 hidden modules

ERROR in 0_aa3b3e2e3fe9df698db2.js from UglifyJs
SyntaxError: Unexpected token: operator (>) [0_aa3b3e2e3fe9df698db2.js:31159,42]

ERROR in 1_11d6f545e155160be150.js from UglifyJs
SyntaxError: Unexpected token: operator (>) [1_11d6f545e155160be150.js:22810,42]

ERROR in 2_8f4603f9a21453379a7f.js from UglifyJs
SyntaxError: Unexpected token: operator (>) [2_8f4603f9a21453379a7f.js:4340,37]

ERROR in 3_891a366cb1d7d1eee19c.js from UglifyJs
SyntaxError: Unexpected token: operator (>) [3_891a366cb1d7d1eee19c.js:2122,42]

ERROR in 4_49bf7cee16d26854081e.js from UglifyJs
SyntaxError: Unexpected token: operator (>) [4_49bf7cee16d26854081e.js:1790,29]

ERROR in 5_be2a0d99e9e534b5d2cd.js from UglifyJs
SyntaxError: Unexpected token: operator (>) [5_be2a0d99e9e534b5d2cd.js:269,42]

ERROR in 6_ba8206d6937196462682.js from UglifyJs
SyntaxError: Unexpected token: operator (>) [6_ba8206d6937196462682.js:32631,31]

ERROR in 7_65bc5567f673853e8f23.js from UglifyJs
SyntaxError: Unexpected token: operator (>) [7_65bc5567f673853e8f23.js:8746,42]

ERROR in 8_d423f62d7179e702b402.js from UglifyJs
SyntaxError: Unexpected token: operator (>) [8_d423f62d7179e702b402.js:1964,42]

ERROR in 9_a068cfdcaeaddbcddef0.js from UglifyJs
SyntaxError: Unexpected token: operator (>) [9_a068cfdcaeaddbcddef0.js:1230,42]

ERROR in app_93f97423d9a2684de121.js from UglifyJs
SyntaxError: Name expected [app_93f97423d9a2684de121.js:42501,14]

npm info lifecycle parabol-action@0.16.0~build:client-deploy: Failed to exec build:client-deploy script

I wonder if this is a side-effect of the new node version or the new babel config?

@mattkrick
Copy link
Member

Hrmmmm, this would make sense because uglify doesn't support ES6.
The confusing part is that I thought we were still transpiling to ES5 in production. whoops!

So, we've got some options:

what's your poison?

@jordanh
Copy link
Contributor Author

jordanh commented Feb 27, 2017

Since this is the client bundle, I think it makes sense for us to revert to transpilation to ES5 for maximum browser compatibility, right?

@jordanh
Copy link
Contributor Author

jordanh commented Feb 27, 2017

In the prod config, I see we're still using babel-loader to transpile. However, our .babelrc has changed:

 jordanhusney   staging  ⋯  github.com  Parabol  action.git  git diff v0.15.3...v0.16.0 -- .babelrc
diff --git a/.babelrc b/.babelrc
index 3ba0c8ad..711cbd2a 100644
--- a/.babelrc
+++ b/.babelrc
@@ -1,8 +1,14 @@
 {
-  "presets": ["react", "es2015", "stage-0"],
+  "presets": ["react"],
   "plugins": [
+    ["transform-class-properties"],
+    ["transform-export-extensions"],
+    ["transform-object-rest-spread"],
+    ["react-hot-loader/babel"],
     ["transform-decorators-legacy"],
-    ["add-module-exports"],
-    ["react-hot-loader/babel"]
+    ["transform-class-properties"],
+    ["transform-es2015-modules-commonjs"],
+    ["transform-es2015-destructuring"],
+    ["transform-es2015-classes"]
   ]
 }

@jordanh
Copy link
Contributor Author

jordanh commented Feb 27, 2017

How about #752 as a reversion?

@jordanh jordanh added the bug label Feb 27, 2017
@mattkrick mattkrick mentioned this issue Feb 28, 2017
5 tasks
@mattkrick
Copy link
Member

fixed by #752

mattkrick added a commit that referenced this issue Feb 28, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants