Michael Clifford
01/20/2022, 7:31 PMbundle.format: 'esm'
with ApolloAPI
, I get the following when trying to make a request:
Unhandled Promise Rejection {"errorType":"Runtime.UnhandledPromiseRejection","errorMessage":"Error: Dynamic require of \"stream\" is not supported","reason":"Error: Dynamic require of \"stream\" is not supported","promise":{},"stack":["Runtime.UnhandledPromiseRejection: Error: Dynamic require of \"stream\" is not supported"," at process.<anonymous> (file:///home/mclifford/Development/github.com/cliffom/sst-bff-demo/node_modules/@serverless-stack/aws-lambda-ric/lib/index.js:34:23)"," at process.emit (node:events:390:28)"," at emit (node:internal/process/promises:136:22)"," at processPromiseRejections (node:internal/process/promises:242:25)"," at processTicksAndRejections (node:internal/process/task_queues:97:32)"]}
Michael Clifford
01/20/2022, 7:38 PMthis.setDefaultFunctionProps({
runtime: 'nodejs14.x',
bundle: {
format: 'esm'
}
});
// Create the Apollo GraphQL API
const apollo = new sst.ApolloApi(this, 'ApolloApi', {
server: new sst.Function(this, 'ApolloLambda', {
handler: 'src/handlers/apollo/lambda.handler',
environment: {
USERS_API_URL: props?.usersAPI.url as string,
STAGE: scope.stage,
},
}),
});
thdxr
01/20/2022, 8:04 PMthdxr
01/20/2022, 8:05 PM