The React hook used to determine the current documentation version used a dynamic import with import(@site/versions.json'. The base Webpack config has an alias for @site, allowing the import to resolve as expected. However, if the versions file does not exist, an exception will be thrown, and the try/catch in the hook empirically is unable to handle it.
Maybe a custom Webpack resolver could be written to provide a default empty array if the file doesn't exist? (Just a hunch this might be possible... A custom loader won't work, as those only run when the file exists.)
The React hook used to determine the current documentation version used a dynamic import with
import(@site/versions.json'
. The base Webpack config has an alias for @site, allowing the import to resolve as expected. However, if the versions file does not exist, an exception will be thrown, and the try/catch in the hook empirically is unable to handle it.Maybe a custom Webpack resolver could be written to provide a default empty array if the file doesn't exist? (Just a hunch this might be possible... A custom loader won't work, as those only run when the file exists.)