-
Notifications
You must be signed in to change notification settings - Fork 33
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
Dart client should accept/prefer "local" as subdomain for local-cli development now that localhost is deprecated #107
Comments
Unfortunately, if that is the case (pleases share the doc thank you :D ) it's not yet supported, and you still need to pass 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: nhost/nhost#2139 |
How about using serviceUrls directly for local development?
|
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.
The text was updated successfully, but these errors were encountered: