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

SSR is working on development but not working after build #153

Open
eleviven opened this issue Jan 14, 2021 · 2 comments
Open

SSR is working on development but not working after build #153

eleviven opened this issue Jan 14, 2021 · 2 comments

Comments

@eleviven
Copy link

Hi, i have problem like below

screen

_app.js

import { getDataFromTree } from "@apollo/client/react/ssr";

function MyApp({ Component, pageProps }) {
  return <Component {...pageProps} />;
}

export default withApollo(MyApp, { getDataFromTree });

hoc/withApollo.js

export default withApollo(
  ({ initialState, headers }) => {
    return new ApolloClient({
      headers,
      credentials: "same-origin",
      uri: `${API_URI}/graphql`,
      cache: new InMemoryCache().restore(initialState || {}),
    });
  },
  {
    render: ({ Page, props }) => {
      return (
        <ApolloProvider client={props.apollo}>
          <Page {...props} />
        </ApolloProvider>
      );
    },
  }
);
@ziimakc
Copy link

ziimakc commented Feb 25, 2021

@eleviven hi, did you found a solution?

UPD: in my case it was because httpS://localhost/api/graphql link. When i changed to http - problem was solved/

@jcpsimmons
Copy link

jcpsimmons commented Jun 23, 2021

+1 - is there an ETA on fix for this?

@ziimakc I tried this workaround but no luck

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

3 participants