-
Notifications
You must be signed in to change notification settings - Fork 154
Bug: lib not working for node12 if not bundled with tools like esbuild #899
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
Comments
In our current {
"compilerOptions": {
"lib": ["ES2019"],
"module": "commonjs",
"target": "ES2019"
}
} Maybe this is the issue? But then I don't fully understand why the integration tests we are running don't break. |
Note on this. Target2019 doesn't support //in target 2020
subsegment?.close(); will be: //in target 2019
subsegment === null || subsegment === void 0 ? void 0 : subsegment.close(); This is fine functionally. But it reduces our unit test branch coverage and breaks our commit/push hooks. The options to fix this are:
Ref: https://linguinecode.com/post/how-to-solve-typescript-possibly-undefined-value |
|
Bug description
Node12 with standard bundling of lambda does not work and throw
Runtime.UserCodeSyntaxError: SyntaxError: Unexpected token '.'
Expected Behavior
Installing and bundling my lambda with powertools "normally" should work on node12 runtime.
Current Behavior
Given a function bundled as a zip including
@aws-lambda-powertools/*
modules innode_modules
and importing the lib in theindex.js
such as:When triggered, it will throw the following exception if runtime is Node12.x:
Possible Solution
Steps to Reproduce
Check https://github.com/awslabs/aws-lambda-powertools-typescript/runs/6521588868?check_suite_focus=true
or
An easyway to reproduce is to test the lambda layer
git clone https://github.com/awslabs/aws-lambda-powertools-typescript.git cd layer-publisher npm ci RUNTIME=node12.x npm run test:e2e
You will get the following failure
Environment
Related issues, RFCs
detected while testing layer: #884
The text was updated successfully, but these errors were encountered: