thdxr
10/27/2021, 12:59 PMthdxr
10/27/2021, 1:00 PMDan Van Brunt
10/27/2021, 1:00 PMDan Van Brunt
10/27/2021, 1:03 PMDan Van Brunt
10/27/2021, 1:03 PMthdxr
10/27/2021, 1:03 PMDan Van Brunt
10/27/2021, 1:04 PMyarn deploy
flips it back to prod files?thdxr
10/27/2021, 1:05 PMDan Van Brunt
10/27/2021, 1:07 PMDan Van Brunt
10/27/2021, 1:07 PMthdxr
10/27/2021, 1:07 PMthdxr
10/27/2021, 1:07 PMDan Van Brunt
10/27/2021, 2:23 PMDan Van Brunt
10/27/2021, 2:44 PMcopyFiles
and the base handler?
I can now see both files in the directory… but the lambda is erroring out with …
{
"errorType": "Runtime.HandlerNotFound",
"errorMessage": "lib/constructs/ApiSite/lambda.handler is undefined or not exported",
"stack": [
"Runtime.HandlerNotFound: lib/constructs/ApiSite/lambda.handler is undefined or not exported",
thdxr
10/27/2021, 2:47 PMthdxr
10/27/2021, 2:47 PMDan Van Brunt
10/27/2021, 2:49 PMconst apiSite = new sst.Api(this, 'ApiSite', {
defaultFunctionProps: {
bundle: {
copyFiles: [{ from: './contentful-app-frontend/build', to: './build' }],
},
},
routes: {
'ANY /': 'lib/constructs/ApiSite/lambda.handler',
'ANY /{proxy+}': 'lib/constructs/ApiSite/lambda.handler',
},
})
Dan Van Brunt
10/27/2021, 2:53 PMDan Van Brunt
10/27/2021, 2:54 PMDan Van Brunt
10/27/2021, 3:06 PMDan Van Brunt
10/27/2021, 3:06 PM{
"errorType": "Runtime.HandlerNotFound",
"errorMessage": "lib/constructs/ApiSite/lambda.handler is undefined or not exported",
"stack": [
"Runtime.HandlerNotFound: lib/constructs/ApiSite/lambda.handler is undefined or not exported",
" at Object.module.exports.load (/var/runtime/UserFunction.js:144:11)",
" at Object.<anonymous> (/var/runtime/index.js:43:30)",
" at Module._compile (internal/modules/cjs/loader.js:1072:14)",
" at Object.Module._extensions..js (internal/modules/cjs/loader.js:1101:10)",
" at Module.load (internal/modules/cjs/loader.js:937:32)",
" at Function.Module._load (internal/modules/cjs/loader.js:778:12)",
" at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76:12)",
" at internal/main/run_main_module.js:17:47"
]
}
Dan Van Brunt
10/27/2021, 3:07 PMDan Van Brunt
10/27/2021, 3:07 PMthdxr
10/27/2021, 3:09 PMDan Van Brunt
10/27/2021, 3:11 PMDan Van Brunt
10/27/2021, 3:13 PMthdxr
10/27/2021, 3:14 PM/frontend
in the codethdxr
10/27/2021, 3:14 PMthdxr
10/27/2021, 3:15 PMexport default { handler }
syntax works? I don't typically export that wayDan Van Brunt
10/27/2021, 3:15 PMDan Van Brunt
10/27/2021, 3:15 PMDan Van Brunt
10/27/2021, 3:15 PMDan Van Brunt
10/27/2021, 3:15 PMDan Van Brunt
10/27/2021, 3:16 PMDan Van Brunt
10/27/2021, 3:16 PMDan Van Brunt
10/27/2021, 3:17 PMthdxr
10/27/2021, 3:18 PMthdxr
10/27/2021, 3:18 PMconst { handler } = require("./file")
vs
import { handler } from "file"
Slight difference which causes it to fail depending on how file
is bundledDan Van Brunt
10/27/2021, 3:28 PM