Skip to content

Uncaught Error reading '__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED' #3864

@monscamus

Description

@monscamus

When I run the latest Graphiql component in my React test project I get the following error.

Uncaught TypeError: Cannot read properties of undefined (reading '__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED')

Image

The key code I use is (for AWS):

  return isAuthenticated ? (
    <Suspense fallback=''>
      <GraphiQL fetcher={async (graphQLParams) => {
        const tokens = await (await fetchAuthSession()).tokens;
        let tok: string = tokens?.idToken === undefined ? '' : tokens.idToken?.toString();

        const data = await fetch(newFunction(), {
          method: "POST",
          headers: {
            Accept: "application/json",
            "Content-Type": "application/json",
            Authorization: tok,
          },
          body: JSON.stringify(graphQLParams),
          credentials: "same-origin",
        });
        return data.json().catch(() => data.text());

        function newFunction(): RequestInfo {
          return import.meta.env.VITE_GRAPHQL_ENDPOINT;
        }
      }} />;

Thought you guys should know (hope nobody gets fired).

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