On July 12th (yesterday) 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:
Open the ci/install_deps.sh file
Change the second line, “npm install -g serve” to
“npm install -g serve@13.0.4”
Commit the change
Terminate your session and reopen it
Please comment below if you are continuing to experience any issues!
If you’re still seeing issues, try this fix as well:
Hi Thomas! I’m not sure what happened but the live preview now works! I made an additional change to the “grunt-webpack” line from 4.0.0 to 4.0.3 in the package.json file and it seems like it refreshed after 10 min! Not sure if that fixed the issue but it was the only change I made since then.
Hi Amanda, that’s the right fix for your issue! Version 4.0.0 of grunt-webpack did not support Version 5 of Webpack, which is used in the Theme. That was the cause of the errors you saw. They created a patch Version (4.0.3) to allow grunt-webpack to work with Version 5 of Webpack.
Hello! I have tried implementing all of the fixes (apply diff and the two above) and I am still not able to view my live preview. Could anyone assist? Thanks!
I tried to implement a fix for this but was given different directions from Engineering ticket which resulted in console errors for me. Since I had to commit the change I was wondering if there is a way to undo the commit so I can use this fix instead? I’m currently getting console errors and the live preview will not load as a result of changes to the package-lock.json file.
Hi, I am getting an error after implementing this fix:
“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.”
I checked my serve.sh config file and 8080 is set in the CI Config. Can anyone advise an alternative solution to get this Live Preview working?
You will need to remove the line npm install -g serve. I verified that this fixes the Preview issue. 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, your ci/serve_setup.sh was overriding this behavior and re-installing serve as the latest version, instead of v13.0.4.
I Know this is an old topic, but I’m experiencing the same issue and this fix doesn’t seem to be working. Here is my current setup. Any help is appreciated.
#!/bin/sh
export NODE_OPTIONS="--max-old-space-size=1024"
#This will use development mode while in the Yext code editor. Set to "false" to test the production build.
export IS_DEVELOPMENT_PREVIEW='true'
serve -l 8080 desktop/ &
grunt watch