firebase / extensions

Source code for official Firebase extensions
https://firebase.google.com/products/extensions
Apache License 2.0
882 stars 374 forks source link

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

Open mehmet2006 opened 1 month ago

mehmet2006 commented 1 month ago

[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:

[REQUIRED] Step 2: Describe your configuration

[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