Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

TypeError: Cannot read property 'replace' of undefined - Not sure where it's originating as I don't use replace in the repo

When I run my expo project I am getting a console warning stating.

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 unsure where this is coming from as I only use replace is below but I have changed that and still get the error.

const makeURL = (url: string) => {
    return `${API_URL}/${url?.replace(/^\/+/, '')}`;
};

I have had a look for matchFileNameOrURLFromStackTrace and there are no traces of it anywhere.

Any help to be pointed in the right direction would be appreciated.

Cheers

like image 421
sewb Avatar asked Dec 06 '25 03:12

sewb


1 Answers

The issue has been fixed (https://github.com/expo/expo-cli/issues/3473).

npm i -g expo-cli and that has solved the error for me.

like image 175
sewb Avatar answered Dec 07 '25 17:12

sewb