New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deploy should be able to handle asynchronous operations in modules #775
Comments
Cloud Functions works with Node 6 -- async await is not available.
Dependencies are not totally compiled by typescript, thus the error. We are
working on Node 8 support, but do not have a timeline to announce.
…On Sun, May 20, 2018, 12:53 AM Amit Moryossef ***@***.***> wrote:
Version info
3.18.4
Platform Information
Windows
Steps to reproduce
- Start a new "project" with functions
- npm i ***@***.***
- In index, add import * as oauth2 from 'simple-oauth2';
- firebase deploy --only functions
Expected behavior
Should succeed.
Actual behavior
Does not succeed. The simple-oauth2 library includes async functions,
which firebase does manage to handle at least for my code. It should be
able to handle async operations in modules as well.
Function load error: Code in file lib/index.js can't be loaded.
Is there a syntax error in your code?
Detailed stack trace:
/user_code/node_modules/simple-oauth2/lib/client/auth-code.js:45
async function getToken(params) {
^^^^^^^^
SyntaxError: Unexpected token function
at createScript (vm.js:56:10)
at Object.runInThisContext (vm.js:97:10)
at Module._compile (module.js:549:28)
at Object.Module._extensions..js (module.js:586:10)
at Module.load (module.js:494:32)
at tryModuleLoad (module.js:453:12)
at Function.Module._load (module.js:445:3)
at Module.require (module.js:504:17)
at require (internal/module.js:20:19)
at Object. (/user_code/node_modules/simple-oauth2/index.js:4:24)
Should also mention, the tsconfig that was generated is:
{
"compilerOptions": {
"lib": ["es6"],
"module": "commonjs",
"noImplicitReturns": true,
"outDir": "lib",
"sourceMap": true,
"target": "es6"
},
"compileOnSave": true,
"include": [
"src"
]
}
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#775>, or mute the
thread
<https://github.com/notifications/unsubscribe-auth/AAAD_uTqHyIRkAD9BW_qB-bgdyq-hBgNks5t0SDxgaJpZM4UF_aG>
.
|
@mbleigh Thanks for the quick & to the point reply. |
@mbleigh may I ask if you are working on a Node 10 support too? I had an impression that you are not releasing Node 8 because you are waiting for Node 10. |
I used 1.6 and it worked. |
This is now supported with Node 8; we will be closing the issue. |
Version info
3.18.4
Platform Information
Windows
Steps to reproduce
npm i simple-oauth2@2.0.1
import * as oauth2 from 'simple-oauth2';
firebase deploy --only functions
Expected behavior
Should succeed.
Actual behavior
Does not succeed. The
simple-oauth2
library includesasync
functions, which firebase does manage to handle at least for my code. It should be able to handleasync
operations in modules as well.Should also mention, the
tsconfig
that was generated is:The text was updated successfully, but these errors were encountered: