Open josoroma-zz opened 4 years ago
Your first screenshot tells you that Node doesn't recognize the export
keyword.
Indeed, Node < 13 doesn't support ECMAScript modules.
So it's not a serverless-google-cloudfunctions problem and this issue could be closed
Use require
Transpile your code from ESNext
to a node12
target before deploying it. You can use https://github.com/serverless-heaven/serverless-webpack or https://github.com/floydspace/serverless-esbuild for example
@CorentinDoue Do you have an example of setting up GCP with ESBuild? I keep getting:
Error: Failed to require one of the files /syncs/.esbuild/.build/index.js, /syncs/.esbuild/.build/function.js
I am trying to do this same pattern of having an index.ts
file with these exports. ESBuild does not put the file into the build folder.
On a side note, does anyone know why Google enforces files to be like this? AWS' implementation is far simpler. Is this a limitation brought by GCP or this lib?
Error: Deployment failed: RESOURCE_ERROR
serverless.yml
index.js
src/graphql.js
src/tes.js
Thanks!