From version 5.1.0 to 5.1.1, the p-limit package dependency was updated from v2.x.x to v3.x.x
p-limit v3.x.x uses syntax that makes the package incompatible with environments running any JavaScript version older than ES2019. This sudden environment requirement is a major change, and a breaking change for platforms that rely on Google Cloud Functions which are limited to Node 8 and Node 10.
@google-cloud/storage version: 5.1.1It will throw this error:
Error: Error occurred while parsing your function triggers.
C:\projects\...\functions\node_modules\p-limit\index.js:30
} catch {}
^
SyntaxError: Unexpected token {
This looks to be because that library is using try {} catch {} as opposed to try {} catch (e) {}. This is not an issue in our supported range of Node versions (>= 10), but is back in 8. Due to this, we won't be able to resolve this. If you can upgrade, that should resolve the issue. Alternatively, you can try using @google-cloud/storage versions prior to our 5.0 release, which is when Node 8 support was dropped.
Most helpful comment
This looks to be because that library is using
try {} catch {}as opposed totry {} catch (e) {}. This is not an issue in our supported range of Node versions (>= 10), but is back in 8. Due to this, we won't be able to resolve this. If you can upgrade, that should resolve the issue. Alternatively, you can try using@google-cloud/storageversions prior to our 5.0 release, which is when Node 8 support was dropped.