You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I believe that since the library depends on private class properties which is supported in
Nodejs 12 runtime, it will not work with netlify-lambda that appears to run with nodejs 8 runtime
according to the README.
Describe the solution you'd like
A way to choose the nodejs runtime by setting the environment variable locally perhaps like:
An error like this happens when trying to require simple-oauth2 and using netlify-lambda serve:
oauth-netlify-practice/node_modules/simple-oauth2/lib/client.js:19
#config = null;
^
SyntaxError: Invalid or unexpected token
at Module._compile (internal/modules/cjs/loader.js:723:23)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Module.require (internal/modules/cjs/loader.js:692:17)
at require (internal/modules/cjs/helpers.js:25:18)
at Object.<anonymous> (auth-netlify-practice/node_modules/simple-oauth2/index.js:3:16)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
The text was updated successfully, but these errors were encountered:
jaytula
added
the
type: feature
code contributing to the implementation of a feature and/or user facing functionality
label
Sep 21, 2020
Is your feature request related to a problem? Please describe.
I am trying to
import
the npm librarysimple-oauth2
and use it with a netlify functionand also use
netlify-lambda
to test locally.I believe that since the library depends on private class properties which is supported in
Nodejs 12 runtime, it will not work with netlify-lambda that appears to run with nodejs 8 runtime
according to the README.
Describe the solution you'd like
A way to choose the nodejs runtime by setting the environment variable locally perhaps like:
https://www.netlify.com/blog/2019/12/04/node.js-12-now-available-for-netlify-functions/
Additional context
An error like this happens when trying to require
simple-oauth2
and usingnetlify-lambda serve
:The text was updated successfully, but these errors were encountered: