Hitchhikers Theme Live Preview Updates | Yext Hitchhikers Platform

Node 12 No Longer Supported

July 14, 2022

Bug:

On July 12th, 2022 the npm package serve released version 14, which drops support for node 12. This update resulted in live previews running on node 12 no longer working.

We’ve updated the answers-hitchhiker-theme’s template repo to no longer have this issue, however repos that currently experience this issue will need to be manually updated.

Fix instructions:

  1. Open the ci/install_deps.sh file.
  2. Change the second line, npm install -g serve to npm install -g serve@13.0.4.
  3. Commit the change.
  4. Terminate your session and reopen it.

Conflicting Peer Dependency with grunt-webpack

July 14, 2022

book
Note
This issue has been addressed in the Theme 1.29.1 patch.

Bug:

dependency grunt-webpack error

Could not resolve dependency: 
peer webpack@"^4.0.0" from grunt-webpack@4.0.2
node modules/grunt-webpack
  dev grunt-webpack@"^4.0.0" from the root project

Conflicting peer dependency: webpack@4.46.0
node_modules/webpack
  peer webpack@"^4.0.0" from grunt-webpack@4.0.2
  node_modules/grunt_webpack
    dev grunt-webpack@"^4.0.0" from the root project

If you experience the above live preview issue with grunt-webpack, you should be able to resolve the issue by specifying grunt-webpack version 4.0.3 in your package.json.

Fix instructions:

  1. Open the package.json file in the Code Editor.
  2. Look for the line that defines your grunt-webpack version, it should look like "grunt-webpack": "4.0.0". If it is on a version less than 4.0.3, for example 4.0.0 or 4.0.2, change it to 4.0.3.
  3. Commit your change, terminate your session, and re-open it.
  4. The next time you make changes to your repo, you will see changes to a file called package-lock.json. This is expected, and is the result of npm propagating the grunt-webpack upgrade throughout your package-lock.

This issue was due to incompatibility between the grunt-webpack and webpack v5. Previous versions of grunt-webpack had the following peer dependency: webpack: ^4.0.0. This caused issues for certain Node versions because we use v5 of webpack. However, v4.0.3 of grunt-webpack has the peer dependency: webpack: ^4.0.0 || ^5.0.0.

Server Application Unavailable

July 14, 2022

Bug:

Server application unavailable. To use live preview, please
ensure you have configured a web server on port 8080 in 
your CI Config serve command. Please view the console 
logs for any errors establishing the web server.

Fix instructions:

  1. Open the ci/serve_setup.sh file. It’ll look something like:

    #!/bin/sh 
    npm install -g serve 
    npx jambo build 
    grunt webpack
  2. Remove the line npm install -g serve.

  3. Commit the change.

  4. Terminate your session and reopen it.

A specific version of serve needs to be installed for Preview to run (v13.0.4). The ci/install_deps.sh script already installs this specific version of serve. But, the ci/serve_setup.sh file was overriding this behavior and re-installing serve as the latest version, instead of v13.0.4.