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

ERR_INVALID_URL for any api requests #79

Open
aivanouski opened this issue May 15, 2024 · 1 comment
Open

ERR_INVALID_URL for any api requests #79

aivanouski opened this issue May 15, 2024 · 1 comment

Comments

@aivanouski
Copy link

TypeError: Invalid URL
at new NodeError (node:internal/errors:393:5)
at URL.onParseError (node:internal/url:565:9)
at new URL (node:internal/url:645:5)
at default_1 (/project/node_modules/near-api-js/lib/utils/setup-node-fetch.js:20:77)
at HTTPClient.DEFAULT_FETCHER [as fetcher] (/project/node_modules/@leonardo-ai/sdk/src/lib/http.ts:18:12)
at HTTPClient.request (/project/node_modules/@leonardo-ai/sdk/src/lib/http.ts:63:30)
at User.do$ (/project/node_modules/@leonardo-ai/sdk/src/lib/sdks.ts:124:42)
at processTicksAndRejections (node:internal/process/task_queues:95:5)
at User.getUserSelf (/project/node_modules/@leonardo-ai/sdk/src/sdk/user.ts:83:26)
at Website.generateVideo (/project/src/infinite/libs/website.ts:192:18) {
input: '[object Request]',
code: 'ERR_INVALID_URL'
}

const me = await this.leonardo.user.getUserSelf();
      console.log(me);

or

// Generate Image
      const imageGenerationResponse = await this.leonardo.generation.createGeneration({
        height: 768,
        width: 1024,
        numImages: 1,
        prompt: functionCallSettings.functionArgs?.text || 'An ocean wave',
        public: false,
        alchemy: true,
        modelId: '1e60896f-3c26-4296-8ecc-53e2afecc132',
      });
@Inject('LEONARDO')
    private readonly leonardo: Leonardo,
 providers: [
  ..
    {
      provide: 'LEONARDO',
      useFactory: () =>
        new Leonardo({
          serverURL: 'https://cloud.leonardo.ai/api/rest/v1',
          bearerAuth: process.env.LEONARDO,
        }),
    },
  ],

node v18.12.1
yarn 1.22.19
"@leonardo-ai/sdk": "^4.10.1",

@aivanouski
Copy link
Author

I have update near-api-js library, and now it works. but it's weird.

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