Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Miss configured sourcemaps ? #9

Open
benjamindulau opened this issue Jan 11, 2023 · 0 comments
Open

Miss configured sourcemaps ? #9

benjamindulau opened this issue Jan 11, 2023 · 0 comments

Comments

@benjamindulau
Copy link

On a project created with create-react-app, I get the following error when starting or building the app:

Capture d’écran 2023-01-11 à 12 06 02

Incriminated code:

// src/config/apollo-client.ts

import { ApolloClient, createHttpLink } from "@apollo/client";
import { setContext } from "@apollo/client/link/context";
import { createPersistedQueryLink } from "@apollo/client/link/persisted-queries";
import { usePregeneratedHashes } from "graphql-codegen-persisted-query-ids/lib/apollo";
import hashes from "../gql/persisted-query-ids/client.json";
import { apolloCache } from "./apollo-cache";

export default function initApolloClient(session: any) {
  const httpLink = createHttpLink({
    uri: window.ENV.GRAPHQL_SERVER_URL,
  });

  const authLink = setContext((_, { headers }) => {
    return {
      headers: {
        ...headers,
        authorization: `Bearer ${session.appToken}`,
      },
    };
  });

  const persistedQueryLink = createPersistedQueryLink({
    useGETForHashedQueries: false,
    // eslint-disable-next-line
    generateHash: usePregeneratedHashes(hashes),
  });

  return new ApolloClient({
    link: authLink.concat(persistedQueryLink).concat(httpLink),
    cache: apolloCache,
  });
}
@benjamindulau benjamindulau changed the title Miss configured sourcemaps Miss configured sourcemaps ? Jan 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant