Skip to main content

Restore Overridden console.log

· 2 min read
Hung Viet Nguyen
Developing Jest Preview and Vitest Preview

Sometimes during development, you might encounter situations where console.log has been overridden. This commonly happens in production builds where logging is disabled to prevent exposing sensitive information or to improve performance. However, when debugging, you might need to restore the original console.log functionality.

Remove old service worker

· One min read
Hung Viet Nguyen
Developing Jest Preview and Vitest Preview

Recently, I migrated a documentation page from Gatsby to Docusaurus. However, after I deployed a new version of the docs but I still see the cached version of the old docs. The reason is that the Gatsby version of the docs has a service worker that caches the artifacts. So, I need to remove the old service worker manually via Chrome Devtools.

Customize HTML in Jest

· One min read
Hung Viet Nguyen
Developing Jest Preview and Vitest Preview

In some scenarios, you may want to customize the HTML in Jest to align with your actual app's HTML structure. You can do it by one of the following options:

Cannot run gpg No such file or directory

· One min read
Hung Viet Nguyen
Developing Jest Preview and Vitest Preview

git -c user.useConfigOnly=true commit --quiet --allow-empty-message --file - error: cannot run gpg: No such file or directory error: gpg failed to sign the data fatal: failed to write commit object

Answer:

git config --global gpg.program "$(which gpg)"