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

Viewed 529

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

1 Answers
Related