I'm trying to develop using localhost on one machine (via localhost:5000/graphql
) and using Github codespaces on another (via https://githubuser-repo-wackycode-5000.githubpreview.dev/graphql
).
In my index.tsx
I have:
const graphqlHost: string = (process.env.GRAPHQL_HOST as string);
console.log(graphqlHost);
const httpLink = createHttpLink({
uri: graphqlHost,
credentials: 'same-origin'
});
My .env (located just outside of /src
looks as follows:
# GRAPHQL_HOST="localhost:5000/graphql"
GRAPHQL_HOST="https://githubuser-repo-wackycode-5000.githubpreview.dev/graphql"
Error I'm getting (obviously not resolving .env):
Module not found: Can't resolve 'graphql'
Everything does would when the uri
is hardcoded.
What's the proper .env setup I'm missing?