#Uncaught TypeError: Cannot read properties of undefined (reading 'baseURL')

2 messages · Page 1 of 1 (latest)

twin juniper
#

Only when pre-rendering my homepage in production, I see this error in the console:
Uncaught TypeError: Cannot read properties of undefined (reading 'baseURL')

I disabled code minification to see the clear code in the production build:

const appConfig = useRuntimeConfig$1().app;
const baseURL = () => appConfig.baseURL; //Complains here.
const buildAssetsDir = () => appConfig.buildAssetsDir;
const buildAssetsURL = (...path) => joinRelativeURL(publicAssetsURL(), buildAssetsDir(), ...path);
const publicAssetsURL = (...path) => {
  const publicBase = appConfig.cdnURL || appConfig.baseURL;
  return path.length ? joinRelativeURL(publicBase, ...path) : publicBase;
};

{
  globalThis.__buildAssetsURL = buildAssetsURL;
  globalThis.__publicAssetsURL = publicAssetsURL;
}
#
  routeRules: {
    '/': { prerender: true },
  },