Skip to content

Docker build fails on Building static HTML from built JS #9712

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

Closed
subwiz opened this issue Jun 8, 2018 · 2 comments
Closed

Docker build fails on Building static HTML from built JS #9712

subwiz opened this issue Jun 8, 2018 · 2 comments

Comments

@subwiz
Copy link

subwiz commented Jun 8, 2018

My Environment

  • OS: Mac High Sierra
  • Node JS: 10.4.0
  • Yarn: 1.6.0

Steps to reproduce the issue

I'm trying to get Jetpack up using Docker. When I issued yarn docker:up, the containers started and WP was accessible. When I accessed the Jetpack menu in wp-admin, I received the error:

capto_capture 2018-06-08_12-22-23_pm

As instructed, I did yarn distclean && yarn build, which resulted in this error for me:

[12:14:57] Dashboard RTL CSS finished.
[12:14:57] DOPS Components RTL CSS finished.
[12:14:58] Building static HTML from built JS…
[BABEL] Note: The code generator has deoptimised the styling of "/Users/user/code/jetpack/_inc/build/static.js" as it exceeds the max of "500KB".
fs.js:159
  throw new ERR_INVALID_CALLBACK();
  ^

TypeError [ERR_INVALID_CALLBACK]: Callback must be a function
    at maybeCallback (fs.js:159:9)
    at Object.fs.writeFile (fs.js:1278:14)
    at Stream.<anonymous> (/Users/user/code/jetpack/gulpfile.babel.js:256:9)
    at Stream.emit (events.js:187:15)
    at drain (/Users/user/code/jetpack/node_modules/through/index.js:34:23)
    at Stream.stream.queue.stream.push (/Users/user/code/jetpack/node_modules/through/index.js:45:5)
    at Stream.end (/Users/user/code/jetpack/node_modules/through/index.js:15:35)
    at _end (/Users/user/code/jetpack/node_modules/through/index.js:65:9)
    at Stream.stream.end (/Users/user/code/jetpack/node_modules/through/index.js:74:5)
    at DestroyableTransform.onend (/Users/user/code/jetpack/node_modules/vinyl-fs/node_modules/readable-stream/lib/_stream_readable.js:523:10)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Any thoughts on why this may happen?

@subwiz
Copy link
Author

subwiz commented Jun 8, 2018

On further investigation, I found that my one of my attempts to rectify another issue using yarn upgrade resulted in a modified yarn.lock that was causing the reported issue. After reverting yarn.lock, and to the committed version in master, when I tried to build, I was getting:

[1/5] 🔍  Validating package.json...
[2/5] 🔍  Resolving packages...
[3/5] 🚚  Fetching packages...
error [email protected]: The engine "node" is incompatible with this module. Expected version ">=4 <=9".
error Found incompatible module
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Based on the instructions found here, I issued yarn config set ignore-engines true before firing yarn build. Now, the build is failing just as initially reported:

[12:51:21] Dashboard RTL CSS finished.
[12:51:22] DOPS Components RTL CSS finished.
[12:51:22] Building static HTML from built JS…
[BABEL] Note: The code generator has deoptimised the styling of "/Users/user/code/jetpack/_inc/build/static.js" as it exceeds the max of "500KB".
fs.js:159
  throw new ERR_INVALID_CALLBACK();
  ^

TypeError [ERR_INVALID_CALLBACK]: Callback must be a function
    at maybeCallback (fs.js:159:9)
    at Object.fs.writeFile (fs.js:1278:14)
    at Stream.<anonymous> (/Users/user/code/jetpack/gulpfile.babel.js:256:9)
    at Stream.emit (events.js:187:15)
    at drain (/Users/user/code/jetpack/node_modules/through/index.js:34:23)
    at Stream.stream.queue.stream.push (/Users/user/code/jetpack/node_modules/through/index.js:45:5)
    at Stream.end (/Users/user/code/jetpack/node_modules/through/index.js:15:35)
    at _end (/Users/user/code/jetpack/node_modules/through/index.js:65:9)
    at Stream.stream.end (/Users/user/code/jetpack/node_modules/through/index.js:74:5)
    at DestroyableTransform.onend (/Users/user/code/jetpack/node_modules/vinyl-fs/node_modules/readable-stream/lib/_stream_readable.js:523:10)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

@subwiz
Copy link
Author

subwiz commented Jun 8, 2018

Downgraded to Node 8.11.2, and the build works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants