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've followed the SAR quick-start guide in the repo and deployed the deno layer. I've then created a new function from scratch, chosen custom runtime and added the deno layer as per the instructions. I've uploaded the latest code (deno-lambda-example.zip v1.32.5) to the function. However when I run a test for the first time I get the following error:
Response
{
"errorMessage": "unable to compile hello.ts",
"errorType": "InitException"
}
Function Logs
error: Module not found "file:///var/runtime/mod.ts".
at file:///var/task/hello.ts:5:8
error: unable to compile hello.ts
error: Module not found "file:///var/runtime/mod.ts".
at file:///var/task/hello.ts:5:8
error: unable to compile hello.ts
START RequestId: 170ee5c6-39c3-45d5-b469-9571a14a936e Version: $LATEST
Unknown application error occurred
Runtime.Unknown
END RequestId: 170ee5c6-39c3-45d5-b469-9571a14a936e
The import it is failing on is this code (unmodified from the zip file):
Looking at the code in the repo and examining the zip files, there is no mod.ts file at the root of deno-lambda-example.zip (which would be uploaded to /var/runtime I believe).
Looking at the generation of the zip files, it would appear that mod.ts should be referenced by it's full URL (https://deno.land/x/lambda/mod.ts) and retrieved from the deno cache in .deno-dir. Thus, if I update the import in hello.ts to:
I get it to work, but with a slow init/cold start as it is downloading the dependencies from scratch rather than using the cached copies in the .deno-dir directory included in the deno-lambda-example.zip. Output from this change:
Function Logs
Download https://deno.land/x/lambda/mod.ts
Warning Implicitly using latest version (1.32.5) for https://deno.land/x/lambda/mod.ts
Download https://deno.land/x/lambda@1.32.5/mod.ts
Download https://deno.land/x/lambda@1.32.5/types.d.ts
START RequestId: 3a401818-3eb4-46c5-944e-c0cae35c773b Version: $LATEST
END RequestId: 3a401818-3eb4-46c5-944e-c0cae35c773b
REPORT RequestId: 3a401818-3eb4-46c5-944e-c0cae35c773b Duration: 57.32 ms Billed Duration: 1281 ms Memory Size: 128 MB Max Memory Used: 86 MB Init Duration: 1222.95 ms
Where am I going wrong? Why isn't the .deno-dir cache being used? Any help most appreciated.
The text was updated successfully, but these errors were encountered:
cknight
changed the title
runtime compile error with deno-lambda
runtime compile error with deno-lambda example
Apr 24, 2023
I've followed the SAR quick-start guide in the repo and deployed the deno layer. I've then created a new function from scratch, chosen custom runtime and added the deno layer as per the instructions. I've uploaded the latest code (deno-lambda-example.zip v1.32.5) to the function. However when I run a test for the first time I get the following error:
The import it is failing on is this code (unmodified from the zip file):
Looking at the code in the repo and examining the zip files, there is no mod.ts file at the root of
deno-lambda-example.zip
(which would be uploaded to/var/runtime
I believe).Looking at the generation of the zip files, it would appear that mod.ts should be referenced by it's full URL (
https://deno.land/x/lambda/mod.ts
) and retrieved from the deno cache in.deno-dir
. Thus, if I update the import inhello.ts
to:I get it to work, but with a slow init/cold start as it is downloading the dependencies from scratch rather than using the cached copies in the
.deno-dir
directory included in the deno-lambda-example.zip. Output from this change:Where am I going wrong? Why isn't the
.deno-dir
cache being used? Any help most appreciated.The text was updated successfully, but these errors were encountered: