🐛 [storage-resize-images] Console error when trying to use the extension
[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 (
Expected result
It should resize the images
Actual result
It throws an error
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
Hi @mehmet2006, @bertrandgelinas
Thanks for raising this issue, we're reviewing it and will provide updates as soon as possible!
Hi there,
it seems the source of the JSON parsing error is your use of "curly" or "typographic" double quotation marks in your config:
{ "position": “centre”, "fit": "inside" }
“centre”
“
Please use the standard straight double quotation marks "
like this:
{ "position": "centre", "fit": "inside" }
JSON officially only supports straight quotes (U+0022)
I'm going to close this as complete, feel free to reopen if the issue persists after using striaght quotation marks.