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

Error during retryAwait function: TypeError: Invalid URL #6

Open
AlbertoBonfiglio opened this issue Sep 18, 2024 · 1 comment
Open

Comments

@AlbertoBonfiglio
Copy link

Hello,
I have installed the latest appwrite (6.0) and appwirite-util cli globally
I have a valid appwrite.json in the root directory of my project
I am logged in the development server at http:localhost/v1
I set up an appwriteConfig.ts with endpoint, projectId and key,
I added the database the config file

`  databases: [
    {
      "$id": "main",
      "name": "main",
    }
  ],`

when I run npx --package=appwrite-utils-cli@latest appwrite-migrate --it and select sync or any other option except
setup local directories it gives me the following error:


Error during retryAwait function: TypeError: Invalid URL
An error occurred: TypeError: Cannot read properties of undefined (reading 'databases')
    at fetchAllDatabases (file:///home/darthbert/.npm/_npx/3b529e35b3368a11/node_modules/appwrite-utils-cli/dist/migrations/databases.js:8:36)
    at async UtilsController.syncDb (file:///home/darthbert/.npm/_npx/3b529e35b3368a11/node_modules/appwrite-utils-cli/dist/utilsController.js:163:27)
    at async InteractiveCLI.syncDb (file:///home/darthbert/.npm/_npx/3b529e35b3368a11/node_modules/appwrite-utils-cli/dist/interactiveCLI.js:325:9)
    at async InteractiveCLI.run (file:///home/darthbert/.npm/_npx/3b529e35b3368a11/node_modules/appwrite-utils-cli/dist/interactiveCLI.js:58:21)
    at async main (file:///home/darthbert/.npm/_npx/3b529e35b3368a11/node_modules/appwrite-utils-cli/dist/main.js:133:9)

Any idea of what's happening?

@AlbertoBonfiglio
Copy link
Author

After troubleshooting I found I can make it work by returning config.default instead of config from loadConfig in loadConfig.js.
Do you see a problem with this? I didn't have time to study the code extensively sto see if it may causes side effects.
I am submitting a PR for your review.

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

1 participant