firebase / extensions

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

[storage-resize-images] includePathList check not working when using firebase emulator on Windows #999

Closed windmichael closed 10 months ago

windmichael commented 2 years ago

Configuration

Problem Description

The extension is not working, when using the firebase emulator on a Windows OS. The reason therefore are issues with the path separators.

I detected two issues. For my use case, I configured the extension to only resize images in the "images" path. When uploading an image to the "images" folder, the extension checks, if the newly added images path is included in the "includePathList". But the path for the newly added images is "C:\\images". Thus, I get the following log message: "Image path 'C:\\images' is not supported, these are the supported absolute paths: /images"

The reason therefore is the path separator in Node for Windows OS: https://nodejs.org/docs/latest/api/path.html#pathsep

A similar issue appears for uploading the image to the "images" folder again.

Steps to reproduce:

Start the Firebase emulator with using this extension on a Windows OS.

Expected result

Node uses as separator on Windows "\\". This should be replaces with "/" on the places where using the path.resolve method.

dackers86 commented 2 years ago

Thanks @windmichael. Added to our project board for investigation.

juane1000 commented 2 years ago

I've also just encountered this issue. Is there any update?

EDIT: I also noticed that the specified RESIZED_IMAGES_PATH just gets mangled into the file name instead of proper directories for FB Storage.

remillc commented 1 year ago

I ran into the same issue. This is quite a bummer when developing with this extension under Windows. Please consider working on this issue.

TheKents0209 commented 10 months ago

Any workarounds?

cabljac commented 10 months ago

For tracking purposes, closing this as a duplicate of https://github.com/firebase/extensions/issues/1732