Skip to content
Discussion options

You must be logged in to vote

i used sanctumClient.native and this is working great 🎉, the .raw was returning the same error as above "Failed to execute 'json'..."

import type {paths} from "~/types/schema";
import createClient from "openapi-fetch";

const sanctumClient = useSanctumClient()
const client = createClient<paths>({
  baseUrl: "http://localhost:8000",
  fetch: async (request: Request) => {
    return sanctumClient.native(request.url, {
      method: request.method,
      headers: request.headers,
      body: request.body,
      signal: request.signal,
      credentials: 'include',
    });
  },
})

The other approach I was considering is to move to the HeyApi client; they have an ofetch-based client: https://h…

Replies: 2 comments 7 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
7 replies
@manchenkoff
Comment options

@npldevfr
Comment options

@manchenkoff
Comment options

@npldevfr
Comment options

Answer selected by npldevfr
@manchenkoff
Comment options

@npldevfr
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants