Skip to content

create is not a function #319

@webdevhayes

Description

@webdevhayes

Hello,

I am not sure if this is related to this issue - #316

I have tried v3.0.1 and I still get this error when trying to create the apisauce instance.

TypeError: Bo.create is not a function

I am sure if this is a issue related to vite/esbuild though as if I run this through vite dev everything works as expected. Doing a production build using vite then creates the issue.

I have had to revert back to v2.1.6 and everything is working again.

Just for clarity this is my file.

import {create} from 'apisauce';

const APP_ENV = import.meta.env.VITE_APP_ENV;
const API_PROD_URL = 'url';
const API_LOCAL_URL = 'url';

const httpClient = create({
    baseURL: APP_ENV === 'local' ? API_LOCAL_URL : API_PROD_URL,
});

export default httpClient;

I hope this helps? If you want any help to try and replicate this then let me know :). I hope I have given a give enough explanation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions