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

Astro Project in Vercel doesnt work #768

Closed
Laguilavo10 opened this issue Oct 6, 2023 · 3 comments
Closed

Astro Project in Vercel doesnt work #768

Laguilavo10 opened this issue Oct 6, 2023 · 3 comments

Comments

@Laguilavo10
Copy link

Laguilavo10 commented Oct 6, 2023

Checklist before opening an issue
Lots of issues are opened that are unrelated to this package, please take a moment to ensure the issue is not on your end 🙏.

  • [X ] Did you try google?
  • [ X] Did you search for previous Issues in this repo?

Describe the bug\

I'm using react-image-gallery in an Astro project, it works fine in dev environment, however I upload the project to Vercel and it doesn't work. I get an error 500: FUNCTION_INVOCATION_FAILED
The invocation of a serverless function was not completed successfully. This is an application error.

When I remove the component, the project works fine, so the problem is caused by the library.

Image Gallery Version\

What version of react-image-gallery are you using?
1.3.0

Screenshots
image
image

Client info (please complete the following information):\

  • OS: Windows
  • Browser: Chrome
@xiaolin
Copy link
Owner

xiaolin commented Jan 15, 2024

Not sure what happened here. Is there a better stacktrace you can provide to check on the actual error? The error above does not help much with debugging.

@xiaolin
Copy link
Owner

xiaolin commented Aug 22, 2024

Is Astro ESM? this package is bundled using UMD. Try importing it this way.

import Gallery from 'react-image-gallery';
const ImageGallery = Gallery.default ? Gallery.default : Gallery;

@xiaolin
Copy link
Owner

xiaolin commented Aug 22, 2024

Looks like it is, ill create a ticket to one day support both builds. If someone wants to open a PR for it would be great too.

#801

@xiaolin xiaolin closed this as completed Aug 22, 2024
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

2 participants