Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

103
Views
Why my code is returning TypeError: baseURL.replace is not a function (In 'baseURL.replace(/\/+$/, '')', 'baseURL.replace' is undefined)?

In my React Native App, I'm using apisauce to communicate with my API and trying to get baseURL from firebase firestore. Do do this I'm using anonymous signing in to access the database. I'm getting TypeError as mentioned in question title. Please help me out.

import {create} from 'apisauce';
import auth from '@react-native-firebase/auth';
import firestore from '@react-native-firebase/firestore';

const apiClient = create({
  method: 'POST',
  baseURL: '',
}).setBaseURL(
  async () =>
    await auth()
      .signInAnonymously()
      .then(async () => {
        console.log('success');
        await firestore()
          .collection('service_url')
          .doc('service_url')
          .get()
          .then(async document => {
            await document._data.url.toString();
          })
          .catch(error => console.log(error));
      })
      .catch(error => {
        console.log(error);
      }),
);

export default apiClient;
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!