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

Network error: Only absolute URLs are supported on branch 'browser-apollo-client" #3

Closed
gmanfredi opened this issue Apr 5, 2020 · 6 comments

Comments

@gmanfredi
Copy link

Loving this stack. I find branch browser-apollo-client more simple (as in KISS) than using Sapper's server routes in master, and less boilerplate than svelte-apollo. Is there a compelling reason to use server-routes method? Below error is with browser-apollo-client.

The error I found in browser-apollo-client is that when you run it either with docker-compose up -a or with the development method, the Reviews & Categories page queries all fail with the similar error:

Network error: Only absolute URLs are supported

Error: Network error: Only absolute URLs are supported
    at new ApolloError (/home/gary/development/sand-stack-starter/ui/__sapper__/dev/server/server.js:2370:28)
    at /home/gary/development/sand-stack-starter/ui/__sapper__/dev/server/server.js:3552:40
    at /home/gary/development/sand-stack-starter/ui/__sapper__/dev/server/server.js:3864:25
    at Set.forEach (<anonymous>)
    at /home/gary/development/sand-stack-starter/ui/__sapper__/dev/server/server.js:3862:32
    at Map.forEach (<anonymous>)
    at QueryManager.broadcastQueries (/home/gary/development/sand-stack-starter/ui/__sapper__/dev/server/server.js:3860:22)
    at /home/gary/development/sand-stack-starter/ui/__sapper__/dev/server/server.js:3466:47
@knuspertante
Copy link

@gmanfredi this should be the same error:

apollographql/apollo-link#1282

@vanbenj
Copy link
Owner

vanbenj commented Jun 2, 2020

I need to update this project - it's quite out of date.

I have another private project that is based on this repo where I've updated a number of things and all these issue are resolved. I'll take some time over the next couple of days and update it.

@vanbenj
Copy link
Owner

vanbenj commented Jun 2, 2020

I choose to base my applications on the browser-apollo-client branch. The server route style used in the master branch can be exported but that's really immaterial once if you need to add authentication as was my use case. I haven't had much success getting the browser-apollo-client approach to export but that's not needed for most sites.

@panicst8
Copy link

panicst8 commented Jun 9, 2020

Looking forward to your updated repo. as I had looked at around 10 other repos and yours is the first to work correctly .. Though I get a 500 error when clicking on categories ... but the Reviews tab works so I was able to configure my own setup, but again can't wait to see your updates to repo. :-)

@vanbenj
Copy link
Owner

vanbenj commented Jun 12, 2020

I've made some major changes and greatly cleaned things up. The bugs you described should be fixed. I also added proper tests and CI. I got the Sapper Export working with the Apollo client approach and replaced the master branch with the browser-apollo-client branch.

The README explains some of the nuances around the apollo.js. I replaced the graphql url's with two environment variables, one for the client and one for SSR. Both point to the same server but one is public facing and one is the internal address.

@vanbenj vanbenj closed this as completed Jun 12, 2020
@vanbenj
Copy link
Owner

vanbenj commented Jun 12, 2020

Also no longer doing the reverse proxy as it is not really needed. In practice I find we've put a load balancer in front of things.

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

4 participants