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

400 Bad request when using getPublicUrl #561

Open
2 tasks done
Wizzel1 opened this issue Oct 2, 2024 · 1 comment
Open
2 tasks done

400 Bad request when using getPublicUrl #561

Wizzel1 opened this issue Oct 2, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@Wizzel1
Copy link

Wizzel1 commented Oct 2, 2024

Bug report

  • I confirm this is a bug with Supabase, not with my own application.
  • I confirm I have searched the Docs, GitHub Discussions, and Discord.

Describe the bug

I have an app that displays multiple images in a list. Each of those images is requested via getPublicUrl like so:

export function getPreviewUrl(
  supabase: SupabaseClient<Database>,
  path_tokens: z.infer<typeof pathTokenSchema>,
) {
  try {
    const {
      data: { publicUrl },
    } = supabase.storage
      .from('thumbnails')
      .getPublicUrl(path_tokens.thumbnailPath, { download: true });
    return publicUrl;
  } catch (error) {
    if (error instanceof Error) {
      console.log('Error downloading image: ', error.message);
    }
    Sentry.captureException(error);
    return '';
  }
}

for some reason, sometimes a 400 Bad request error gets thrown but others load just fine. Any idea why this happens?

Expected behavior

I expected to be able to show my "thumbnails" for each image.

Screenshots

Unbenannt

System information

  • OS: Windows
  • Browser: chrome
  • Version of supabase-js: 2.45.4
  • Version of Node.js: 20.15.0

Additional context

Add any other context about the problem here.

@Wizzel1 Wizzel1 added the bug Something isn't working label Oct 2, 2024
@Wizzel1 Wizzel1 changed the title ad 400 Bad request when using getPublicUrl Oct 2, 2024
@fenos
Copy link
Contributor

fenos commented Oct 3, 2024

Hello, can you please share more information about the error you are getting ex:

  • Response payload
  • Logs from the storage-api docker container

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants