googlearchive / cloud-functions-emulator

A local emulator for deploying, running, and debugging Google Cloud Functions.
https://github.com/GoogleCloudPlatform/cloud-functions-emulator/wiki
Apache License 2.0
827 stars 115 forks source link

Error deploying when using babel #318

Open ryrebs opened 5 years ago

ryrebs commented 5 years ago

I'm using express and functions and I got an error:

functions: Error from emulator. mod.hasOwnProperty is not a function

when I deploy my functions locally. I'm using babel to use async/await:

.babelrc:

{
  "plugins": [
    "@babel/plugin-proposal-class-properties",
    [
      "@babel/plugin-transform-runtime",
      {
        "absoluteRuntime": false,
        "corejs": false,
        "helpers": true,
        "regenerator": true,
        "useESModules": false
      }
    ]
  ],
  "presets": ["@babel/preset-env", "@babel/preset-flow"]
}

When I remove this in babel compilation, the error is:

ReferenceError: regeneratorRuntime is not defined

Any help or ideas how to resolve this problem?