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

🐛 [storage-resize-images] Console error when trying to use the extension #2107

Open
mehmet2006 opened this issue May 31, 2024 · 1 comment
Labels
type: bug Something isn't working

Comments

@mehmet2006
Copy link

[READ] Step 1: Are you in the right place?

Issues filed here should be about bugs for a specific extension in this repository.
If you have a general question, need help debugging, or fall into some
other category use one of these other channels:

  • For general technical questions, post a question on StackOverflow
    with the firebase tag.
  • For general Firebase discussion, use the firebase-talk
    google group.
  • To file a bug against the Firebase Extensions platform, or for an issue affecting multiple extensions, please reach out to
    Firebase support directly.

[REQUIRED] Step 2: Describe your configuration

  • Extension name: storage-resize-images (storage-resize-images, firestore-send-email, etc)
  • Extension version: 0.2.5
  • Configuration values (redact info where appropriate):
    • Sharp constructor options for resizing images (Optional)
      { "position": “centre”, "fit": "inside" }
    • _

[REQUIRED] Step 3: Describe the problem

When I add this configuration, extension doesn't work
Sharp constructor options for resizing images (Optional)
{ "position": “centre”, "fit": "inside" }

Steps to reproduce:

1- Install the extension
2- Add "position": “centre”, "fit": "inside" } to the field "Sharp constructor options for resizing images (Optional)"
3- Save
4- Upload image

What happened? How can we make the problem occur?
cloudfunctions.googleapis.com

…loudFunctionsService.UpdateFunction

…orage-resize-images-generateResizedImage
Function failed on loading user code. This is likely due to a bug in the user code. Error message: Provided module can't be loaded.
Is there a syntax error in your code?
Detailed stack trace: SyntaxError: Unexpected token “ in JSON at position 14
at JSON.parse ()
at allowAnimated (/workspace/lib/config.js:39:22)
at Object. (/workspace/lib/config.js:60:15)
at Module._compile (node:internal/modules/cjs/loader:1364:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1422:10)
at Module.load (node:internal/modules/cjs/loader:1203:32)
at Module._load (node:internal/modules/cjs/loader:1019:12)
at Module.require (node:internal/modules/cjs/loader:1231:19)
at require (node:internal/modules/helpers:177:18)
at Object. (/workspace/lib/resize-image.js:9:18)
Could not load the function, shutting down.. Please visit https://cloud.google.com/functions/docs/troubleshooting for in-depth troubleshooting documentation.

Expected result

It should resize the images

Actual result

It throws an error

@mehmet2006 mehmet2006 added the type: bug Something isn't working label May 31, 2024
@bertrandgelinas
Copy link

bertrandgelinas commented Jul 10, 2024

I still get the same problem, though error code is slightly different
Detailed stack trace: SyntaxError: Unexpected token “ in JSON at position 40

I tried to uninstall and reinstall but then i think it gets confused because of same name files.

EDIT : Even when deleting the resized files, it still throws the error

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

No branches or pull requests

2 participants