Closed spakanati closed 1 year ago
Unfortunately, if that is the case (pleases share the doc thank you :D ) it's not yet supported, and you still need to pass localhost
.
I will see if I can spend sometime to fix this.
Thanks! Unfortunately it's not as simple as just passing localhost because the new nhost cli does not even run services on localhost:1337 anymore as far as I know (so local development is broken without any workarounds until this is updated). I believe the specific URLs (local.auth.nhost.run, etc.) need to be used.
I don't have a specific link to the docs but the deprecation of localhost has been discussed on Discord and there is an issue here to remove all references to localhost: https://github.com/nhost/nhost/issues/2139
How about using serviceUrls directly for local development?
serviceUrls: ServiceUrls(
authUrl: '',
storageUrl: '',
functionsUrl: '',
graphqlUrl: '',
),
);```
I tried using the service URLs as a workaround, but it doesn't work because nhost gql links can't connect to the websocket successfully: WebSocketException (WebSocketException: Connection to 'https://local.graphql.nhost.run:0#' was not upgraded to websocket)
Possibly wss is not supported locally, but the URL is https://local.graphql.nhost.run
:
Any updates, I need to test locally and it's seems there is no way to do that
what is the issue? Could someone elaborate a bit more and share logs and errors? I just tested myself and I had no problems using subscriptions using both local.graphql.nhost.run/v1 and local.hasura.nhost.run/v1/graphql
The issue is that Nhost has asked everyone to switch to using subdomain and region to initiate the client and also to stop using "localhost" for local development and instead pass "local" as the subdomain. The dart client is still assuming that "localhost' will be passed as the subdomain that local development is using localhost:1337, which has not been the case for a while with the newer version of cli, so all the examples will fail if you use "local" as the subdomain because the endpoints created are incorrect, and just passing the legacy "localhost" for subdomain as a workaround does not work either since cli services are not actually running at localhost:1337 anymore.
See this incorrect regexp that has not been updated.
It is now possible to use the service URLs workaround and pass each service URL individually to initiate the client, but it should not be necessary because the init code should be fixed to handle subdomain and region correctly in all cases, including local development.
Solved in #119
Currently you have to pass "localhost" or "localhost:1337" as the subdomain for local cli dev: https://github.com/nhost/nhost-dart/blob/main/packages/nhost_dart/lib/nhost_dart.dart#L50
However, Nhost has deprecated localhost as the subdomain and it seems "local" should be used instead.