Upon running my expo project, I encountered a console warning that reads:
TypeError: Cannot read property 'replace' of undefined
at matchFileNameOrURLFromStackTrace (/usr/local/lib/node_modules/expo-cli/src/utils/matchFileNameOrURLFromStackTrace.ts:16:42)
at logStackTrace (/usr/local/lib/node_modules/expo-cli/src/exp.ts:548:31)
at logWithLevel (/usr/local/lib/node_modules/expo-cli/src/exp.ts:590:11)
at Object.write (/usr/local/lib/node_modules/expo-cli/src/exp.ts:656:13)
I am puzzled as to where this error is originating from since I only use replace in the code snippet below, which I have modified and still receive the error.
const makeURL = (url: string) => {
return `${API_URL}/${url?.replace(/^\/+/, '')}`;
};
Despite my efforts, a search for matchFileNameOrURLFromStackTrace
yielded no results whatsoever.
If anyone could steer me in the right direction, I would greatly appreciate it.
Thanks